• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Changing user names in Active Directory

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Changing user names in Active Directory

    Does anyone know of any tools or methods for automating a change of name for AD accounts?

    Due to an integration program with parent co. IT systems we may have to rename all out AD accounts to match the new corporate naming convention.
    "Being nice costs nothing and sometimes gets you extra bacon" - Pondlife.

    #2
    Is there nothing in the Admin tools that fits the bill?

    In my techiedays, I always found Petri to be a handy resource for advice.

    Comment


      #3
      Originally posted by Clippy View Post
      Is there nothing in the Admin tools that fits the bill?

      In my techiedays, I always found Petri to be a handy resource for advice.
      Sadly not. The standard tools will let you do it on a case by case basis but are not practical for circa 5000 users given the time it would take and the scope for human error in the process.

      I'm leaning towards a VB script, something like this:

      Code:
      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
      Reading from a spreadsheet of original and target names.
      "Being nice costs nothing and sometimes gets you extra bacon" - Pondlife.

      Comment


        #4
        Take a look at the admod tool AdMod

        admod -b "<DN>" samaccountname::<new username> userprincipalname::<UPN> givenname::<forename> sn::<surname>

        Ian

        Comment


          #5
          Originally posted by DaveB View Post
          Sadly not. The standard tools will let you do it on a case by case basis but are not practical for circa 5000 users given the time it would take and the scope for human error in the process.

          I'm leaning towards a VB script, something like this:
          DaveB

          If you would like to sling me a script to create a few thousand users, I would be more than happy to do some testing on your behalf. No, I don't want real usernames; just something to test my newfound Windows Server and AD skills on.

          As an addendum, if you wish to change attributes in AD, have a look at AttributeChanger (scroll down past the German to the example to see what it can do).

          If you have trouble registering for the download on account of it all being in German, drop me a PM and I will assist.
          Last edited by Sysman; 2 October 2010, 15:55. Reason: addendum added
          Behold the warranty -- the bold print giveth and the fine print taketh away.

          Comment


            #6
            Originally posted by DaveB View Post
            Does anyone know of any tools or methods for automating a change of name for AD accounts?

            Due to an integration program with parent co. IT systems we may have to rename all out AD accounts to match the new corporate naming convention.
            You can leverage the ADSI API with prett ymuch any scripting language, VBscript, Powershell will have loads of scripts all over the internet. other languages can be used

            Or use the inbuilt tools available on a Domain Controller such as dsmod

            Comment

            Working...
            X