Solved

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

Posted on 2014-03-12
7
1,612 Views
Last Modified: 2014-03-17
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.
0
Comment
Question by:the_omnific
  • 3
  • 2
  • 2
7 Comments
 
LVL 22

Expert Comment

by:yo_bee
ID: 39926082
What happened that you need to manually change this attribute?
0
 
LVL 1

Author Comment

by:the_omnific
ID: 39928000
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.
0
 
LVL 22

Expert Comment

by:yo_bee
ID: 39929313
How many users are we talking about?
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 14

Expert Comment

by:Justin Yeung
ID: 39929997
$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}
}
0
 
LVL 1

Author Comment

by:the_omnific
ID: 39930927
Thanks but I need a command to run for all users that are located in a specific Exchange 2010 Database. Not Active Directory
0
 
LVL 14

Accepted Solution

by:
Justin Yeung earned 500 total points
ID: 39931554
import-module ActiveDirectory
$newhomevalue = "newservername"
$databasename = "your database"

#get users in database from $databasename
$Users = Get-Mailbox -database $databasename

#set every object with msExchHomeServerName to $newhomevalue
foreach ($User in $users)
{
set-aduser $user.SamAccountName -Replace @{msExchHomeServerName=$newhomevalue}
}
0
 
LVL 1

Author Comment

by:the_omnific
ID: 39935925
PERFECT ANSWER!
 
Thank you.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

A brief introduction to what I consider to be the best editor for PowerShell.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
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…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

803 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