We help IT Professionals succeed at work.

Need script help - input.csv > AD query > output.csv

442 Views
Last Modified: 2013-11-05
I have an input file called input.csv that has:

FirstName, LastName, EmployeeID

I want to do the following using a vbscript:

1.  Take Input File
2.  Query AD based on matching a Surname/LastName
3.  If match is found, include it as part of a new output.csv with given name/firstname and surname/last name from Active Directory


Any help is appreciated. (paging Chris-Dent...lol)
Comment
Watch Question

Author

Commented:
Oops...forgot to mention that I need the output.csv to also include the original employeeID column value from the input .csv.

So example would be like this:

Firstname              LastName       EmployeeID
Joe                           Dirt                  12345
Bob                          Smith                55555


Query to AD finds user with a lastname of Dirt....

Output.csv records as:

Firstname              LastName       EmployeeID
Joseph                      Dirt                  12345

You might want to look into using kixtart:
http://www.kixtart.org

it is a very powerfull scripting language, well documented, can take just about any format text file as input, and interface with AD via LDAP and free.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks Rob...
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
No worries.....BTW, I've since discovered that instead of using objRecordSet.Fields(1)
you can use objRecordSet.Fields("adsPath")
so that it explicitly uses that field....

Regards,

Rob.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.