Skip to content

Instantly share code, notes, and snippets.

@alexinnes
Last active August 29, 2015 14:21
Show Gist options
  • Save alexinnes/08fb6d322dab08bb0149 to your computer and use it in GitHub Desktop.
Save alexinnes/08fb6d322dab08bb0149 to your computer and use it in GitHub Desktop.
Hides all disabled accounts from global address list.
#which exchange server
$server = ""
Get-Mailbox -Filter{(HiddenFromAddressListsEnabled -eq $false) -AND (UserAccountControl -eq "AccountDisabled, NormalAccount")}
| where {$_.servername -like "$server"} | set-mailbox -HiddenFromAddressListsEnabled $True
##Must run in exchange console##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment