Re: Bulk rename of user accounts in Active Directory

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bill Nitz (wcnitz_at_gmail.com)
Date: 03/06/05


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



Relevant Pages

  • Re: Bulk rename of user accounts in Active Directory
    ... You can use a variety of methods, but keep in mind that changing the CN ... objUser.Put "name", UserNewName ... Bill ...
    (microsoft.public.scripting.vbscript)
  • Calibrate your Pucker Factor (cont)
    ... Bill O'Reilly is a Zionist Fascist and I'm not. ... Fascism, f or F, is an element of the human condition. ... said that we have requisite variety in our behaviors. ... can differentiate the psychological experience of any emotional event ...
    (alt.politics.bush)
  • Re: Finding useful functions- part 1
    ... > Bill Modlin wrote: ... the genes don't know whether the ... Koch has a neurobiological model of mind which has two aspects. ... Perhaps his idea appears to be more direct to environment ...
    (sci.cognitive)
  • Re: My Cruddy Experience Buying a New Taylor
    ... Plus giving them a piece of my mind. ... > Shana Tovah muthafukkkah!! ... Bill... ... > Leo Tolstoy is one of my favourite authors. ...
    (rec.music.makers.guitar.acoustic)
  • Re: I will have to get back in a little while
    ... Bill, you are only at 27 days, hun. ... One of those important things is for me to realize and keep in mind ... get practical things done without smoking cigarettes. ... Bill S. 27 days smoke free. ...
    (alt.support.stop-smoking)