Solved

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

Posted on 2014-03-12
7
1,566 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 21

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 21

Expert Comment

by:yo_bee
ID: 39929313
How many users are we talking about?
0
 
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

Join & Write a Comment

In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This article will help you understand what HashTables are and how to use them in PowerShell.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now