AD cmdlets 1.4 added new cmdlets and parameters which let you manage email addresses in your environment even if you do not have Exchange Management Shell. This is very handy if you are on Exchange 2003, do not have Exchange cmdlets installed, or just don’t want to switch between snapins.
Here’s the quick overview of what we have added:
Retrieving accounts by any proxy addresses:
Now Get-QADObject, Get-QADGroup, and Get-QADUser all have PrimaryProxyAddress, ProxyAddress and SecondaryProxyAddress parameters which can let you be more specific in your queries and thus retrieve objects much faster (compared to just supplying the address as identity parameter and relying on default resolution).
For example, you could do:
Get-QADUser -ProxyAddress 'x400:C=US;A= ;P=Quest Software;O=Aliso Viejo;S=Sotnikov;G=Dmitry;I=A;'
or
Get-QADUser -SecondaryProxyAddress '*Sotnikov@algorithm.aelita.com'
Adding email addresses:
Just use Add-QADProxyAddress and specify various parameters for specifics (pair with Clear-QADProxyAddress to replace previous addresses):
Get-QADUser company\jsmith |
Add-QADProxyAddress -Address 'smtp:jsmith@company.com' |
Add-QADProxyAddress -Type SMTP -Address 'john.smith@company.com' -Primary |
Add-QADProxyAddress -CustomType 'sip' -Address 'john.smith@company.com'
Removing all addresses:
Did I mention Clear-QADProxyAddress?
Get-QADUser company\jsmith |
Clear-QADProxyAddress |
Add-QADProxyAddress -Address 'smtp:jsmith@company.com' |
Add-QADProxyAddress -Type SMTP -Address 'john.smith@company.com' -Primary |
Add-QADProxyAddress -CustomType 'sip' -Address 'john.smith@company.com'
Removing individual addresses:
Use Remove-QADProxyAddress and it’s parameters to operate on a specific address or a set of addresses:
Get-QADUser |
Remove-QADProxyAddress -Pattern '*@company.com'
Modifying addresses:
Set-QADProxyAddress lets you pick and replace specific addresses:
Get-QADUser |
Set-QADProxyAddress -From '*@source.com' -MakePrimary
or
Get-QADUser |
Set-QADProxyAddress -From '*@before.com' -To '*@after.com'
Enabling or disabling email address policy:
Enable-QADEmailAddressPolicy and Disable-QADEmailAddressPolicy are your respective friends and can be applied to individual objects. For example:
Get-QADUser DomainName\UserName | Disable-QADEmailAddressPolicy
Get-QADUser -City London | Enable-QADEmailAddressPolicy
Happy scripting!
Like this:
Like Loading...