Re: Bulk rename of user accounts in Active Directory
From: Bill Nitz (wcnitz_at_gmail.com)
Date: 03/06/05
- Next message: Herb Martin: "Re: Domain Controller/Global Catalog Planning"
- Previous message: Terence Tan: "AD USERs Unexpected locked out"
- In reply to: Amihai Bareket: "Bulk rename of user accounts in Active Directory"
- Next in thread: Joe Richards [MVP]: "Re: Bulk rename of user accounts in Active Directory"
- Messages sorted by: [ date ] [ thread ]
Date: 6 Mar 2005 06:35:54 -0800
Amihai,
You can use a variety of methods, but keep in mind that changing the CN
is effectively a move, not an attribute change. So if you need to
change a user CN, you need to 'move' that object, even if it's staying
in the same container.
In VBscript, this would be done through something like this:
set objCont = GetObject("LDAP://" & ParentDN)
objCont.MoveHere "LDAP://cn=" & UserOldName & "," & ParentDN, "cn=" &
UserNewName
set objUser = GetObject("LDAP://cn=" & UserNewName & "," & ParentDN)
objUser.Put "name", UserNewName
objUser.SetInfo
Bill
- Next message: Herb Martin: "Re: Domain Controller/Global Catalog Planning"
- Previous message: Terence Tan: "AD USERs Unexpected locked out"
- In reply to: Amihai Bareket: "Bulk rename of user accounts in Active Directory"
- Next in thread: Joe Richards [MVP]: "Re: Bulk rename of user accounts in Active Directory"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|