Re: Renaming a bunch of users with a script
- From: "Bernardo Achirica" <me@xxxxxxxxxxx>
- Date: Thu, 24 Nov 2005 17:16:35 +0100
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
.
- References:
- Renaming a bunch of users with a script
- From: Bernardo Achirica
- RE: Renaming a bunch of users with a script
- From: SubnetJO
- Renaming a bunch of users with a script
- Prev by Date: Re: Executing An Set Of SQL in Text File
- Next by Date: RE: Copy a folder from one server to another using WMI
- Previous by thread: RE: Renaming a bunch of users with a script
- Next by thread: pst files
- Index(es):
Relevant Pages
|