Solved

Active Directory - modify 'msExchHomeServerName' Attribute for 100+ users

Posted on 2014-01-29
6
2,648 Views
Last Modified: 2014-01-30
I have recently discovered that for some reason the 'msExchHomeServerName' Attribute in Active Directory is incorrect for a number of users.
 
I know how to modify this manually in ADSI Edit but is there a simply / script that would assist me in performing this task a lot quicker.
 
Thank you for your assistance.
0
Comment
Question by:the_omnific
[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
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:Ramakrishna Prabhu
ID: 39819979
0
 
LVL 40

Expert Comment

by:footech
ID: 39820049
You should be able to set this with PowerShell with a command like
Set-ADUser -Identity username -Replace @{msExchHomeServerName="/o=Org/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=EXCHANGE"}

Open in new window

To automate it further, you would want perform a query for the desired users and pass that info along to the Set-ADUser command instead of manually specifying the username.  Something like
Get-ADUser -filter {msExchHomeServerName -eq "/o=wrongOrg/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=EXCHANGE"} | Set-ADUser -Replace @{msExchHomeServerName="/o=Org/ou=First Administrative Group/cn=Configuration/cn=Servers/cn=EXCHANGE"} -whatif

Open in new window

I have included the -whatif parameter at the end so that no changes will be made if you run the above.  Remove it when you want to run for real.
0
 
LVL 1

Author Comment

by:the_omnific
ID: 39823020
The second command is not working. Any ideas?

Get-ADUser -filter {msExchHomeServerName="/o=BUSINESS/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=ADRXGE02"} | Set-ADUser -Replace @{msExchHomeServerName="/o=BUSINESS/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=ASYDXGE03"}

Open in new window


Get-ADUser : Error parsing query: 'msExchHomeServerName="/o=BUSINESS/ou=Exchange Administrative Group 
(FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=ADRXGE02"' 

Error Message: 'Operator Not supported: =' at position: '21'.
At line:1 char:1
+ Get-ADUser -filter {msExchHomeServerName="/o=BUSINESS/ou=Exchan ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ParserError: (:) [Get-ADUser], ADFilterParsingException
    + FullyQualifiedErrorId : Error parsing query: 'msExchHomeServerName="/o=BUSINESS/ou=Exchange Administrative Group (FYDIBOHF2 
   3SPDLT)/cn=Configuration/cn=Servers/cn=ADRXGE02"' Error Message: 'Operator Not supported: =' at position: '21'.,Microsoft.ActiveDirectory.Management.Commands.GetADUser

Open in new window

0
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 40

Accepted Solution

by:
footech earned 500 total points
ID: 39823176
Like it says, the operator is not supported (referring to "=").  As in my example you have to use "-eq" for the comparison operator.
Get-ADUser -filter {msExchHomeServerName -eq "/o=BUSINESS/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=ADRXGE02"} | Set-ADUser -Replace @{msExchHomeServerName="/o=BUSINESS/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=ASYDXGE03"}

Open in new window

0
 
LVL 1

Author Comment

by:the_omnific
ID: 39823185
Perfect, it works!
0
 
LVL 1

Author Closing Comment

by:the_omnific
ID: 39823186
Thank you!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video discusses moving either the default database or any database to a new volume.

739 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