• RSS
  • Twitter
  • FaceBook

Exchange Server Forums

Forums | Register | Login | My Profile | Inbox | RSS RSS icon | My Subscription | My Forums | Address Book | Member List | Search | FAQ | Ticket List | Log Out

Change CN attribute to match sAMAccountName

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [Microsoft Exchange 2010] >> General >> Change CN attribute to match sAMAccountName Page: [1]
Login
Message << Older Topic   Newer Topic >>
Change CN attribute to match sAMAccountName - 17.Sep.2014 12:52:13 PM   
nicholashyer

 

Posts: 4
Joined: 8.Jul.2013
Status: offline
Recently I have made a change to the displayname for users so that they would be in the proper format of LastName, Firstname MIDINIT. This is the script I used to do it:

$Users = Get-User -ResultSize unlimited | where {$_.RecipientTypeDetails -eq "UserMailbox"}
ForEach ($User in $Users)
{
$DName = $User.LastName + ", " + $User.FirstName + " " + $user.Initials
$DName = $Dname.Trim()
Set-User $User -Name $DName -DisplayName $DName
Get-User $User | FT Name, DisplayName
$DName = $Null
}



When I ran this script apparently it changed the DN name on all these accounts and google docs sync stopped when all I really wanted to do was change the DisplayName field.

What I am looking for is a script to get the sAMAccountName property and then set it in the DN for my users to get the google sync working again. If I can set the DN back but keep the display name with the new change everything will work fine I think.

Thanks,

Nick
Post #: 1

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [Microsoft Exchange 2010] >> General >> Change CN attribute to match sAMAccountName Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Follow TechGenix on Twitter