I need some help to fix the one line which maps the values of a number to a string in this Hashtable.
Code: Select all
$mailboxType = @{
"0" = "UserMailbox"
"1073741824" = "Shared Mailbox"
"6" = "MailUser"
"7" = "Room"
"8" = "Equipment"
"-2147483642" = "RemoteUserMailbox"
"-1073741818 " = "RemoteUserMailbox-Hybrid Delegate"
}
Get-MsolUser -All |
Where-Object { ($_.blockcredential -eq $true) -and ($_.isLicensed -eq $true) } |
Select-Object DisplayName,
UserPrincipalName,
@{ n = 'Mailbox Type'; e = { $mailboxType[$_.CloudExchangeRecipientDisplayType].GetEnumerator().Value.ToString() } },
isLicensed,
BlockCredential,
Licenses,
LicenseAssignmentDetails,
WhenCreated | Format-Table -AutoSize
The problem is the column Mailbox Type is always empty. But when I just use the default CloudExchangeRecipientDisplayType, the column value is a meaningless decimal number like in https://cloudrun.co.uk/office365/recipi ... directory/
Thank you in advance