Solved

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

Posted on 2014-03-12
7
1,681 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
[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
  • 2
7 Comments
 
LVL 23

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 23

Expert Comment

by:yo_bee
ID: 39929313
How many users are we talking about?
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Office 365 Training for Admins

Learn how to provision tenants, synchronize on-premise Active Directory, and implement Single Sign-On with these master level course.  Only from Platform Scholar

Question has a verified solution.

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

This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

738 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