RE: AD-Users to contacts
- From: "SubnetJO" <SubnetJO@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 22 Nov 2005 10:00:12 -0800
OK... perhaps I've done half work for you.
I've written a script that takes in input the data from a "well formatted"
excel file, creates the contacts in a determined "OU" and then writes an
excel file that show the result of each creation.
You can configure in the script:
- the destination OU
- the default description
- the input excel file
- the output excel file
All other parameters are taken from the excel file.
How the script works.
Initially, the script try to bind the OU you configured. If it cannot, it
quits.
Then the script checks:
- if input in the "email" field in the excel file is correct
- If there is another record in the excel file with the same name
- if there is another contact in the AD woth the same name
If thre are no errors, the script create the contact in AD
How to fill the excel file.
initials
--------
The field "Initials" is free. You may leave it blank, if you want.
Display Name
----------------
"Semi-Free" field.
You can fill this field. If you leave it blank, it will be valued as
"Surname Name".
Description
-------------
"Semi-Free" field.
You can fill this field. If you leave it blank, it will be valued as you
configured in the script filling the variable "Default Description".
-------
You MUST fill this field. If left balnk, the script will not create the
contatct ad will show you the error in the output file.
If you fill this field wrongly, ("@" is not found), the error will be shown
in the output file and the contact will be not created.
You may fill this field with:
a) Full email address like "giovanni.rinaldi@xxxxxxxxxxx"
b) Domain only like "@mydomain.it"
In the b) case, an email address like "name.surname@xxxxxxxxxxx" will be
generated.
ATTENTION!
The script doesn't allow in the email address:
- character ' : will be deleted
- spaces : will be deleted
- letters with accent like "à è ò ..." wil be substituted wth the
corresponding letters without the accent
- Uppercase letters will be substituted whit lowercase letters
Everything automatically.
The script always ignore the first record in the excel file.
The order of the coloumns in the excel file MUST NOT be changed.
You may use this script to create the contacts in the new AD (the second
part of your job), after you ave filled the input file with data (dumping
users in formation from the old directory, the first part of the job).
Those are the main informations. If you have any trouble or doubt, ask me
trough this forum.
Of course, the script is provided AS IS, and there are no warranties at all.
I wrote it "on the fly" and I just tested it twice against my directory
(works fine).
PLEASE, try it on a test enviroment, before.
You may take the script and an excel "input file" (just fields names, as
template) downloading the file at the address below:
http://www.ictsolutions.it/scriptforum/ContactsFromExcel.zip
You will be asked for username and password:
username: scripter
password: scripter
Please, be careful about the case, the web server is unix... (sorry).
Please tell me if it worked for you.
bye,
SubnetJO, Italy
"Alfred Poko" ha scritto:
> Hi All!
> I'm trying to export my AD-users into a csv that will be used to create
> contacts in an other AD.
> Is their a script/tool that could UPDATE contacs in the new AD if they
> exist, create them if they don't and that get the information for that from
> a CSV > > file?
> Regards
> /A
>
>
>
>
.
- Follow-Ups:
- Re: AD-Users to contacts
- From: Alfred Poko
- Re: AD-Users to contacts
- References:
- AD-Users to contacts
- From: Alfred Poko
- AD-Users to contacts
- Prev by Date: Re: login script that moves a user account to an existsting OU
- Next by Date: Re: windows scripting host and active directory
- Previous by thread: AD-Users to contacts
- Next by thread: Re: AD-Users to contacts
- Index(es):
Relevant Pages
|