AD Bulk Import of User modification

S

Stephan

Hello.

I'm trying to figure out a way to import modifications for
all users in my AD. When modifying let's says the Company
name it is no biggy since we all work for the same
company, so i just run a vbs script that changes the
Company for what i need...BUT...
What if i have an Excel file with all the users in my ad
and there description, phone # etc...Can it be done
simply? Can a VBS script be made to read and append to
the specific AD account as it is reading the txt file?
SOme other way? Any other ideas?

Thanks!
 
R

Richard McCall [MSFT]

The ADSI script would loop through the users in the excel spreadsheet
updating the info. This question would be better answered in the
microsoft.public.windows.server.scripting
 
G

Guest

Thanks for the pointer and advice!
Stephan.
-----Original Message-----
The ADSI script would loop through the users in the excel spreadsheet
updating the info. This question would be better answered in the
microsoft.public.windows.server.scripting

--
Richard McCall [MSFT]

"This posting is provided "AS IS" with no warranties, and confers no
rights."
Stephan said:
Hello.

I'm trying to figure out a way to import modifications for
all users in my AD. When modifying let's says the Company
name it is no biggy since we all work for the same
company, so i just run a vbs script that changes the
Company for what i need...BUT...
What if i have an Excel file with all the users in my ad
and there description, phone # etc...Can it be done
simply? Can a VBS script be made to read and append to
the specific AD account as it is reading the txt file?
SOme other way? Any other ideas?

Thanks!


.
 
N

news.comcast.giganews.com

Yes,

I run such a script on a daily basic from .csv data that I get from Human
Resouces. You can do it with a VBS script or use LDIFDE
 
S

Stephan

Thanks for the reply. Do you have an example of the csv
file you use for ldifde? How is the file defined? I am
pretty much trying to implement the same thing here with
getting a file from the HR and importing it ...

Thanks.

Stephan.
 
U

Ulf B. Simon-Weidner

Thanks for the reply. Do you have an example of the csv
file you use for ldifde? How is the file defined? I am
pretty much trying to implement the same thing here with
getting a file from the HR and importing it ...

Thanks.

Stephan.
Hi Stephan,

actually that's the best way: Export a user (perhaps yourself), get the csv
into excel and work with it.

Here's a export I build for you of the builtin Administrator (get rid of the
linebreaks, I put a empty line between the heading and the adminaccount):

DN,objectClass,cn,description,distinguishedName,instanceType,whenCreated,whenCh
anged,uSNCreated,memberOf,uSNChanged,name,objectGUID,userAccountControl,badPwdC
ount,codePage,countryCode,badPasswordTime,lastLogoff,lastLogon,pwdLastSet,prima
ryGroupID,objectSid,adminCount,accountExpires,logonCount,sAMAccountName,sAMAcco
untType,objectCategory,isCriticalSystemObject,displayName,localPolicyFlags,oper
atingSystem,operatingSystemVersion,serverReferenceBL,dNSHostName,rIDSetReferenc
es,servicePrincipalName,frsComputerReferenceBL,showInAdvancedViewOnly,sn,givenN
ame,userPrincipalName,dSCorePropagationData,mail,costcenter,logonHours,userPara
meters,comment,msNPAllowDialin,lockoutTime

"CN=Administrator,CN=Users,DC=nwtraders,DC=msft",user,Administrator,Built-in
account for administering the
computer/domain,"CN=Administrator,CN=Users,DC=nwtraders,DC=msft",4,200311291641
47.0Z,20031129170935.0Z,8194,"CN=Group Policy Creator
Owners,CN=Users,DC=nwtraders,DC=msft;CN=Domain
Admins,CN=Users,DC=nwtraders,DC=msft;CN=Enterprise
Admins,CN=Users,DC=nwtraders,DC=msft;CN=Schema
Admins,CN=Users,DC=nwtraders,DC=msft;CN=Administrators,CN=Builtin,DC=nwtraders,
DC=msft",12470,Administrator,X'5ea7aeffafb4264c80e1c5bd025702bf',66048,0,0,0,12
7146684923086250,0,127184220223326250,127144967974843750,513,X'0105000000000005
150000001c18dac050c319cc38aba2def4010000',1,9223372036854775807,54,Administrato
r,805306368,"CN=Person,CN=Schema,CN=Configuration,DC=nwtraders,DC=msft",TRUE,,,
,,,,,,,,,,,,,,,,,,

Gruesse - Sincerely,

Ulf B. Simon-Weidner
 
N

news.comcast.giganews.com

Stephan,

Here is a snip of what I get from HR / Peoplesoft

first, middle, last, emplid, org_code, title_long, title_short, office_name,
site_code, address, city, state, zip, bus_phone, bus2_phone, fax_phone,
cell_phone, page_phone, ps_account_name, ps_job_title
LAURA, N, CICHON, 03665, 3321, EM Engineering, EM Eng, Chicago Office,
100CHGO, 10 West 35th Street, Chicago, IL, 60616, 312/567-4268, , , , ,
lcichon, TECHNICAL EDITOR
SHIRLEY, A, MANGAN, 55495, 9236, Payroll, Payroll, Chicago Office, 100CHGO,
10 West 35th Street, Chicago, IL, 60616, 312/567-4140, , 312/567-4141, , ,
smangan, SUPERVISOR PAYROLL

The data fields are name, id, org code, office info, address, phones etc.

I use a Perl script to reformat the data, do error checking, create
Distribution list setc and create an output file which resembles

dn: CN=Laura N Cichon,CN=Users,DC=alionscience,DC=com
changetype: modify
replace: description
description: __0113 EM Engineering_03665
-
changetype: modify
replace: title
title: TECHNICAL EDITOR
-
changetype: modify
replace: initials
initials: N
-
changetype: modify
replace: displayName
displayName: Cichon, Laura N
-
changetype: modify
replace: telephoneNumber
telephoneNumber: 312-567-4268
-

dn: CN=Shirley A Mangan,CN=Users,DC=alionscience,DC=com
changetype: modify
replace: description
description: __0113 Payroll_55495
-
changetype: modify
replace: title
title: SUPERVISOR PAYROLL
-
changetype: modify
replace: initials
initials: A
-
changetype: modify
replace: displayName
displayName: Mangan, Shirley A
-
changetype: modify
replace: telephoneNumber
telephoneNumber: 312-567-4140
-

NOTE: Most of the other data fields only appear in the file above IF they
are changed from the previous day so that updates run faster.

The actual command file is

rem use y - lazy commits
ldifde -y -v -i -k -f \\email1a\user_info\00alion.ldf > 00alion.txt

and I redirect the output so I can scan for errors.

The main items are that:

1. The field name IE telephoneNumber MUST be spelled exactly as it shows in
the AD
2. Each entry ends with a "-" and a blank line
3. The first entry for each staff member MUST have exactly the same name as
shows up in AD

If you want, you can mail me directly at (e-mail address removed)

Ed
 
C

Cary Shultz [A.D. MVP]

Gruesse and Greetings!

I might throw in my $0.02 for this.

While I like using ldifde the syntax can be a bit troublesome ( as Ed
mentioned - and Thank You! for the example of how to modify an existing
account ).

I like a tool called ADModify. It was written by two Microsoft guys and is
available at the following link:

ftp://ftp.microsoft.com/PSS/Tools/Exchange%20Support%20Tools/ADModify/

Download it and play with it. It will save you a great amount of time....

HTH,

Cary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top