Link to home
Start Free TrialLog in
Avatar of ncomper
ncomper

asked on

Script needed to Search AD for specific Server listed as Expansion Server for Dist Lists and then change it

Hi All

We are about to Decomission an Exchange server however it has a large number of Distribution list that it is listed as the expansion server for, I need a script that will search AD for Distribution lists that have this server (EXCHSVR05) listed as there Expansion server and then Change it to (EXCHSVR07)

Thanks

Avatar of DavidGerald
DavidGerald

Hi

Code from:
http://www.technogist.com/tag/ad/
Searching for DL's with Exchange Expansion Servers



You will need Quest Active Roles, its free and quick to install.
Get-QADGroup -SearchRoot 'OU=GrouOU,DC=company,DC=com' -SizeLimit 0 -LdapFilter '(msExchExpansionServerName=*)' -IncludeAllProperties | Select-Object name,msexchexpansionservername,managedby

Open in new window

Avatar of ncomper

ASKER

Hi David

Thanks for the reply, so looking at your example would my script be the below

Get-QADGroup -SearchRoot 'OU=Exchange,DC=company,DC=com' -SizeLimit 0 -LdapFilter '(msExchExpansionServerName=EXCHSVR05)' -IncludeAllProperties | Select-Object name,msexchexpansionservername,managedby EXCHSVR07

or have i put my source and Target server in the script incorectly.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of DavidGerald
DavidGerald

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ncomper

ASKER

Thanks