Solved

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

Posted on 2010-09-06
4
708 Views
Last Modified: 2012-05-10
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

0
Comment
Question by:ncomper
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:DavidGerald
ID: 33609924
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

0
 
LVL 5

Author Comment

by:ncomper
ID: 33609979
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
0
 
LVL 2

Accepted Solution

by:
DavidGerald earned 500 total points
ID: 33610101
Oh I see you are not just searching but editing the attribute as well.  I didn't read the question properly.

Bit more complex and without working it out on a lab I can't be sure, my powershell scripting is still pretty basic.


This is probably completely wrong but I think it embodies the concept, this might require someone with more time on powershell, if no one else joins in and you can't find the answer I will take a look on a lab server




Get-QADGroup -SearchRoot 'OU=GrouOU,DC=company,DC=com' -Sizelimit 0 -LdapFilter '(msExchExpansionServerName=EXCHSVR05)' | foreach {set-QADgroup -msExchExpansionServerName EXCHSVR07}

Open in new window

0
 
LVL 5

Author Closing Comment

by:ncomper
ID: 33723542
Thanks
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Installing 3rd Party SSL for enabling LDAP over SSL 13 37
outlook 6 42
exchange, SPF 21 19
Office365 Outgoing bulk mail limitation 6 9
Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question