Alan's sysadmin Blog

Working smarter not harder

PowerShell Script to hide users from GAL

Posted by Alan McBurney on August 13, 2009


This script using Quest Active Roles will check Active Directory for disabled accounts and then hide these from the Exchange GAL.

[PS] C:\> Get-QADUser | Where-Object { $_.AccountisDisabled -eq “TRUE” -and $_.MailNickName -like “*” } | Set-QADUser -ObjectAttributes @{msExchHideFromAddressLists=”TRUE”;ShowInAddressBook=””}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: