If you need to hide multiple users from Exchange Server 2007 /2010 /2013 from the GAL using PowerShell you can use the cmdlet below for Users with Mailbox or just for Mail contact:
1. Create a text file with the list of users in and call save it as Users.txt
2. Open EMC and run the cmdlet below to Hide:
get-content users.txt | Set-Mailbox -HiddenFromAddressListsEnabled $true
Tu Un-Hide use:
get-content users.txt | Set-Mailbox -HiddenFromAddressListsEnabled $false
If you have a mail contact just use the cmdlets below:
get-content users.txt |Set-MailUser -HiddenFromAddressListsEnabled $true
get-content users.txt |Set-MailUser -HiddenFromAddressListsEnabled $false