Question : Powershell - Hiding Exchange 03 mailbox from GAL w/WMI

I do not have Exchange 07, therefor I can't use teh Exchange Snapins, however I've read where you can accomplish teh same functions on 2003 using WMI calls.. So I'm looking for the command to Hide a mailbox from the GAL using WMI.

Overall Im trying to create a Powershell script that will:

Disable the specified user's AD account
Move the disabled account to a Disabled OU
Hide the mailbox from teh GAL
Then edit the Description field to replace the contents with "TERM" and todays date

Answer : Powershell - Hiding Exchange 03 mailbox from GAL w/WMI


You'd benefit from the Quest AD CmdLets a lot for this:

http://www.quest.com/powershell/activeroles-server.aspx

Then your script goes something like this.

If it must be native PowerShell, no snap-ins, then that's also possible, however, this is the easiest method.

Chris
1:
2:
3:
4:
5:
6:
7:
8:
$User = "someone"
# Hide from address list and fix description
Set-QADUser $User -Description "TERM $(Get-Date)" `
  -ObjectAttributes @{ msExchHideFromAddressLists = $True }
# Disable the account
Disable-QADUser $User
# Move the account
Move-QADObject $User -NewParentContainer "domain.com/Disabled Accounts"
Random Solutions  
 
programming4us programming4us