Private/ADLookups/_UsersExchangeTabLookup.ps1
function _UsersExchangeTabLookup { $OutputObject = $AllUsers | Where-Object SamAccountName -EQ $ADLookups_ExchangeTabSamAccountNameComboBox.Text if ($null -eq $OutputObject) { $ErrorString = "Unable to validate provided username. Make sure this is a SamAccountName.`nYou can verify this in the first tab, 'Find'." _ShowMessageBox -MessageText $ErrorString -ButtonType OK -MessageIcon Warning -MessageTitle "User's Exchange Tab Error" } else { $ADLookups_ExchangeTabEmailAddressTextBox.Text = $OutputObject.EmailAddress $ADLookups_ExchangeTabMailboxTypeTextBox.Text = switch ($OutputObject.msExchRecipientTypeDetails) { 1 { 'UserMailbox' } 4 { 'SharedMailbox' } 128 { 'MailUser' } 2147483648 { 'Remote User Mailbox (365)' } 34359738368 { 'Remote Shared Mailbox (365)' } 33554432 { 'Linked User' } 8388608 { 'Arbitration Mailbox' } 536870912 { 'Discovery Search Mailbox' } 8589934592 { 'Remote Room Mailbox (365)' } 17179869184 { 'Remote Equipment Mailbox (365)' } 4398046511104 { 'Audit Log Mailbox' } 549755813888 { 'Monitoring Mailbox' } default { '' } } if ($OutputObject.msExchHideFromAddressLists) { $ADLookups_ExchangeTabHiddenInGALCheckBox.IsChecked = $true } else { $ADLookups_ExchangeTabHiddenInGALCheckBox.IsChecked = $false } $ADLookups_ExchangeTabProxyAddressesTextBox.Text = (($OutputObject.proxyaddresses -like 'smtp:*') | _OutSingleStringFromArray).replace('; ',"`n") } } |