Active Directory 2003 - LDIFDE or Script to Change account names

inverted_2000
inverted_2000 used Ask the Experts™
on
Hey everyone one,

I'm not too familiar with this, but I understand the use of LDIFDE and what it can do.  I need to change about 200 users account names in our AD from (Firstname Lastname) to (Firstname.Lastname) so that we can be compliant with LDAP standards.

I figure a loop will accomplish this, but I'd like to try it out without a loop first to a single test account (Test Lastname).

Can anyone help me with a script or where I can dig one up please.

Thanks a bunch,
inverted
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007
Commented:
I would checkout ADModify.net (used for bulk AD changes): http://www.gotdotnet.com/workspaces/workspace.aspx?id=f5cbbfa9-e46b-4a7a-8ed8-3e44523f32e2

Pretty straight forward and easy to use. For your scenario; you'll need to select all your users - on the modify/properties sheet switch to the Account tab - check the UPN box - and put the following in for the account name: %'givenName'%.%'sn'%   (which will do firstname.lastname). And don't forget to change the @ drop-down to the right to show your domain name or it will blank that out on each individual users' properties.

Obviously test it out on one user first - but I think you'll like the program.

Author

Commented:
Where do I download it from...I downloaded the .zip file but it only has the .dll files in it.

Author

Commented:
Never mind...I had the 2.2 release...2.1 has the executables.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
I'll play with that too, but can LDIFDE be used to accomplish this?

Thanks again,
inverted
Top Expert 2007

Commented:
LDIF can definitely be used for the same purpose by exporting, modifying, then importing again...but I've never used it for that purpose so I'm not certain what the correct syntax would be.

Author

Commented:
Kewl...I'd like to see if anyone else has attempted to automate this request via LDIFDE first...but your ADModify.net recommendation will surely do the job well.

I'll check back in a few days.

Thanks a lot,
inverted
Top Expert 2007

Commented:
I found this article: http://blog.scottlowe.org/2006/06/20/mass-changes-in-active-directory/

I was able to follow the directions (with a couple tweaks) to change my own login to Firstname.Lastname. It involves using CSVDE to export; notepad to create a template; LogParser to use that template @ CSV file to generate a .LDF. Then....LDIFDE to import that .LDF with changes back into AD.

If you do give it a shot - in the article where CSVDE is used - after the "-l" switch you'd want to use dn,sn,givenname (instead of dn,mail) so you have the necessary data in the CSV file. And you have to tweak the UserPrincipalName in the template a bit (in my template I used "%field_4%.%field_5%@domain.com" (without the quotes) to get the desired Firstname.Lastname.

Author

Commented:
That looked great too...I think I'll stick with the first one though...seemed more automated.  

Do you have a link for all of the CN field names in the Gernal Tab in AD too please?  That will get me rolling.

Thanks a ton
Top Expert 2007

Commented:
I think these are all correct:
First Name = givenName
Last Name = sn
Initials = initials
Display Name = displayName
Description = description
Office = physicalDeliveryOfficeName
Telephone number = telephoneNumber
E-mail = mail
Web page = wWWHomePage

Author

Commented:
Thanks a bunch...u rock!!!
Top Expert 2007

Commented:
Good luck with it all! Glad to help...

Author

Commented:
Sorry...but one last thing...

I don't see how to change the Pre-Windows 2000 field.

I'd rather not have the users logon with Firstname.Lastname@domain.com if I can just get them to logon with Firstnam.Lastname.

Did you see an option in ADModify.net to chantge that?  I'm not seeing it in their directions.

Thanks again for everything.
Top Expert 2007

Commented:
No worries =) Once you're on the properties/modify sheet switch to the Custom tab. Check the box for 'Make a customized attribute modification'...in the two fields enter the following:
Attribute name = sAMAccountName
Attribute value = %'givenName'%.%'sn'%

(sAMAccountName is the value for the pre-windows 2000 user logon field)

I would recommend changing the UPN value at the same time just so the two are identical...

Author

Commented:
Awesome...you're why this site rocks!!!

Thanks again,
Chris

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial