RE: AD-Users to contacts

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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".


Email
-------
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
>
>
>
>
.



Relevant Pages

  • Re: AD-Users to contacts
    ... Hi SubnetJO! ... > I've written a script that takes in input the data from a "well formatted" ... > excel file that show the result of each creation. ... after you ave filled the input file with data (dumping ...
    (microsoft.public.windows.server.scripting)
  • help in scripting excel2k3
    ... I had this script that would open an Excel File, loop through it then close the file. ... It worked when I had ExcelXP installed on my machine, but now I can't get the script to work with Excel2k3. ... WScript.Echo "No input file provided. ... Set objExcel = WScript.CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: Multiple append in text files
    ... I have a script making an inventory in excel from hardwareinfo in about ... At every logon there is one hardware file and one software file created ... Or can i get the info from the excel file software.xls into ...
    (microsoft.public.scripting.vbscript)
  • vbscript and excel
    ... I am writing some vb script that is writing to an excel file. ... Set objExcel = CreateObject ...
    (microsoft.public.vb.syntax)
  • Re: Script to update home folder
    ... > to" path for my users in AD. Do you know of a script that will read ... > information from an excel file and update the home folder path? ... Sample script that read data from file and creates users in AD based on ... which creates users based on the data which comes from excel file: ...
    (microsoft.public.win2000.active_directory)