?
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
Medium Priority
?
726 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
New style of hardware planning for Microsoft Exchange server.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦
Suggested Courses
Course of the Month7 days, 22 hours left to enroll

765 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