Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Read from CSV and Compare info against AD

$
0
0

Hello,

I have a CSV file that I am treating as Master file. Not all of the headers from the CSV are part of a user in AD.

The master CSV has the following headers:

"Last Name","First Name","Last 4 SSN","Month of Birth","Day of Birth","COMPANY Employee ID","Titles","Department Name","Phone Number"

Need to compare"Company Employee ID" header from the CSV against the employeeNumber of AD User, if they match output the following headers to a new CSV.

Headers from the new CSV: "Last Name","First Name","Last 4 SSN","Month of Birth","Day of Birth","COMPANY Employee ID","Titles","Department Name","Phone Number","Email Address"

But, "Last Name"  and"First Name" comes from AD

"Last 4 SSN","Month of Birth","Day of Birth" comes from the master CSV file

"COMPANY Employee ID","Titles","Department Name", comes from AD,

"COMPANY Employee ID" is employeeNumber in AD. "Titles" is title in AD. "Department Name" is department in AD

"Phone Number" comes from the master CSV file

and"Email Address" comes from AD

if they do not match, the record from the master CSV needs to be part of the new CSV with the same headers mentioned above: "Last Name","First Name","Last 4 SSN","Month of Birth","Day of Birth","COMPANY Employee ID","Titles","Department Name","Phone Number","Email Address"

Thanks for your help, will really appreciate any guidance in the code.


Viewing all articles
Browse latest Browse all 6937

Trending Articles