Link to home
Start Free TrialLog in
Avatar of Carl Billington
Carl BillingtonFlag for Australia

asked on

Modify msExchHomeServerName AD attribute for all users in a specific Exchange Database

Is there a way of modifying 'msExchHomeServerName' Active Directory attribute for all users that are located in a specific Exchange 2010 Database?
 
Thanks for your help.
Avatar of yo_bee
yo_bee
Flag of United States of America image

What happened that you need to manually change this attribute?
Avatar of Carl Billington

ASKER

It's pointing at the wrong Exchange server and CommVault is failing to see these mailboxes. When I manually change this attribute CommVault works successfully.
 
This is why I need this command.
 
Thanks.
How many users are we talking about?
$OU = "ou=1,dc=2,dc=3,dc=4"
$newhomevalue = "newservername"

$users = get-aduser -filter * -searchbase $OU

foreach ($User in $users)
{
set-aduser $user.samaccountname -Replace @{msExchHomeServerName=$newhomevalue}
}
Thanks but I need a command to run for all users that are located in a specific Exchange 2010 Database. Not Active Directory
ASKER CERTIFIED SOLUTION
Avatar of Justin Yeung
Justin Yeung
Flag of United States of America image

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
PERFECT ANSWER!
 
Thank you.