How to Remove Mail Users from the Global Address List | Practical365
默认情况下,Exchange 附带五个内置地址列表和一个 GAL
查看用户所在的地址列表:
Get-Mailbox -Identity user01 | fl AddressListMembership
找出不在地址列表中显示的邮箱
Get-Mailbox -ResultSize Unlimited | where {$_.HiddenFromAddressListsEnabled -eq “$true”}
导出AD禁用的帐号
Get-ADUser -Filter {Enabled -eq “false”} -Properties * | select DisplayName,UserPrincipalName,LastLogonDate | sort LastLogonDate -Descending | Export-Csv c:\disable01.csv -Encoding utf8
将禁用的账号在地址列表中隐藏
Get-Mailbox -ResultSize unlimited | where { $_.AccountDisabled -eq ‘True’} | Set-Mailbox -HiddenFromAddressListsEnabled:$true