Re: Renaming a bunch of users with a script



Thank you SubnetJO !!!

I have been a couple of days without news access and when I have read you message, I have already found a solution... and yes... I have to rename ALL of my 17.000 users to convert name, surname, displayName and cn to uppercase !!! (pretty stupid, I know, but let's say that I am forced to do it)

This is how I finally did it:

I made a script that changes the name (givenName), surname (sn) and displayName of all of the users (no problem with this), but at the same time that I change them I create an output file with the following information for every user

dn: old distinguishedName
changeType: modrdn
newRdn: new distinguishedName
deleteOldRdn:1

then I only have to import that file with ldifde to change all the RDNs !!

If somebody is interested, just shout out loud and I will send you the scripts !!!! ;-)

Rgds,
--
Bernardo Achirica Rodriguez
IBERIA - Dirección de Sistemas
Subdirec. Producción / U. Producción Red
bachirica [at] iberia [dot] es

"SubnetJO" <SubnetJO@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:F0EF0863-DCCC-467E-A553-48ED430E52E3@xxxxxxxxxxxxxxxx
Hi bernardo.

I thought  you don't want to rename ALL your users, but selectively only a
part of them.

Well, I wrote a script that takes the input from a text file, where you
write down the list of the users you want to rename.
The script lets you change descriptio, samaccountname, CN, SN....

You don't need to specify the path wahere the user you want to rename is.
The sript will find the user for you.
You have only:
- to provide the data filling the txt file (dumping from your AD)
- Configure your domain in the script (example: "forum.mydomain.com")
- Tell the script where the inpu file is...

Double click... :-)))

Of course, the script is provided AS IS, so no warranty is provided.
I testded it against my AD twice, it works fine.
I always suggest to test the code against a test enviromen, expecially if is
the code of "someone in the internet"... ;-)


You can download the script and a sample input file at the url:
http://www.ictsolutions.it/scriptforum/Rename.zip

Please, take care about the letter case if you write the address in you
address bar.
The web server is unix... (sorry).

You will be asked for credentials. Use:
username: scripter
password: scripter


Please, let me know if it works for you, or you need some modifcation...

I hope this can help.
SubnetJO, Italy




"Bernardo Achirica" ha scritto:

Hi all !!!

I have the need to rename a lot of users of my AD (arounf 20.000) to
eliminate accents and things like that and make them compatible with a pass
sync product.


I am preparing a script in VBScript to rename them and I have no problem
changing the displayName, sn and givenName attributes. The problem comes
when I try to change one of the following attributes: canonicalName, cn,
distinguishedName or name (which I also have to change)

When you rename a user using the AD MMC, all of these attributes are changed
at the same time even though the cn is the RDN...


How can I do it with a script????

Thanks !!

--
Bernardo Achirica Rodriguez
IBERIA - Dirección de Sistemas
Subdirec. Producción / U. Producción Red
bachirica [at] iberia [dot] es



.



Relevant Pages

  • Re: Script to Rename Computer Name in Domain
    ... i looking a script to rename computer name in domain server 2003 ... To rename a computer you bind to the parent OU/Container of the computer ... you would need to also prompt for the current name. ... ' Bind to the parent OU/container of computer object. ...
    (microsoft.public.windows.server.scripting)
  • Re: Rename File Using Strring Found in File?
    ... OK, thanks, but the script does not seem to rename the files. ... # sleep 1; ... to the string in this particular file that I want to match. ...
    (comp.lang.perl.misc)
  • Re: rename a local group in windows 2003
    ... strComputer = objShell.ExpandEnvironmentStrings ... I tried to rename several local groups using the MoveHere method ... Didn't matter if I ran the script on the ... WinNT provider only rename domain groups, ...
    (microsoft.public.windows.server.scripting)
  • Re: Script to Rename Computer Name in Domain
    ... To rename a computer you bind to the parent OU/Container of the ... the local computer, you must run a script ... you can prompt for the new name with an InputBox ... ' Bind to the local computer object. ...
    (microsoft.public.windows.server.scripting)
  • Re: 2001 - rule
    ... I will have to try and find a copy of entourage 2001 lying around to ... (script compiler had me add an extra "then" in the last clause, ... repeat with aRecipient in theRecipients ... displayName as text) ...
    (microsoft.public.mac.office.entourage)