Announcement

Collapse
No announcement yet.

Rename all AD accounts

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

  • Rename all AD accounts

    Hello all, this is my first post here and it's a good one....I'm thinking about renaming every account and email address I have in my AD (approx 300 users).
    We've got a mix of Windows 2k and 2K3 servers and 1 Exchange 2k3 server. I'm not happy with the way I originally setup our user's naming convention a couple years ago and want to change each user's logon account and email address. How can I go about such a stupid endeavor?

    Thanks!

  • #2
    Re: Rename all AD accounts

    Someone may have a more elegant solution for the email address and it depends if you are after really changing their email address or merely changing the address field in AD (don't know if you are using Exchange, if so it's easily done in your site setup) but here's how you can rename user accounts:

    Set objOU = GetObject("LDAP://ou=ouname,dc=domain,dc=suffix")

    objOU.MoveHere _
    "LDAP://cn=SmithJo,ou=ouname,dc=domain,dc=suffix", "cn=Smith_John"

    The above uses the MoveHere command to rename SmithJo to Smith_John.

    You could export the current login names to a spreadsheet, use concatenate to setup the commands for the new usernames and paste it into a script.

    Or, you could get real creative, pull each username in turn and apply your rename algorythm based on the first and last name.

    Comment


    • #3
      Re: Rename all AD accounts

      JP1, what do you have as the naming setup now and what do you want to change it too? Remember also, if you change the user's logon name, you are going to have 300 users to retrain!! Unless you use an alias for their new email address, it is going to make a mess of incoming emails and any clients/recipients are going to have the old email address in thier address books. The changes will extend to beyond your immediate Domain.
      1 1 was a racehorse.
      2 2 was 1 2.
      1 1 1 1 race 1 day,
      2 2 1 1 2

      Comment


      • #4
        Re: Rename all AD accounts

        Right now our logon names are a bit cryptic, not sure why I did it, but it seemed like a good idea at the time. I'd like to change it to FirstinitialLastname. I'm aware of the email issues and would keep the old email addys for a while. As far as training goes, my users can't log in now so this is designed to try to help matters.

        I did find something called ADModify and tested it a little bit. I was able to change the logon name, but not the Pre-Windows 2000 name. Guess that's better than nothing.

        Thanks

        Comment


        • #5
          Re: Rename all AD accounts

          Originally posted by jp1 View Post
          I was able to change the logon name, but not the Pre-Windows 2000 name. Guess that's better than nothing.

          Thanks
          Actually, it's not better than nothing. Nothing is in fact better than not changing the Pre-Windows 2000 name. A sharp stick in the eye is also better.
          VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
          boche.net - VMware Virtualization Evangelist
          My advice has no warranties. Follow at your own risk.

          Comment


          • #6
            Re: Rename all AD accounts

            Originally posted by jasonboche View Post
            Actually, it's not better than nothing. Nothing is in fact better than not changing the Pre-Windows 2000 name. A sharp stick in the eye is also better.
            What do you mean by this?

            Comment


            • #7
              Re: Rename all AD accounts

              You will need to be able to change the pre-windows 2000 names or you will not be successful. There is no partial success if you cannot change the pre-windows 2000 name.
              VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
              boche.net - VMware Virtualization Evangelist
              My advice has no warranties. Follow at your own risk.

              Comment


              • #8
                Re: Rename all AD accounts

                OK then...Anyone out there have a script that I can use to change the Pre-2000 logon account names?

                Comment


                • #9
                  Re: Rename all AD accounts

                  Unfortunately I do not, but the scripting repositories located on the internet are growing each and every day. I would bet dollars to doughnuts that this script has already been invented somewhere in the form of VBS or WSH. The key will be in the automation and intelligence piece. "Given a username of Sally.Rogers, how does the script know that it needs to be converted to rogers01?". It's going to need to look at some of the other AD object attributes I suspect to figure out what the Pre-Windows 2000 name should be. Also how will it handle any conflicts that may come up?

                  The Scripting Guys has a repository and I believe Don Jones does also. I'd look there. Google might also be a safe bet if you use the correct key words to find what you're looking for.

                  Jas
                  VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
                  boche.net - VMware Virtualization Evangelist
                  My advice has no warranties. Follow at your own risk.

                  Comment


                  • #10
                    Re: Rename all AD accounts

                    Update....Thru the use of ADModify and a script I have now successfully changed email addresses, User Logon, and Pre-2000 Logon.

                    Now I'm trying to change the Exchange Alias. Any hints?

                    Thanks.

                    Comment

                    Working...
                    X