Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-03-12
7
Medium Priority
?
1,811 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
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 2000 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

610 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