• Status: Open
  • Priority: Medium
  • Security: Public
  • Views: 35
  • Last Modified:

pulling user account info with powershell

I have a csv file with two columms of first names and lastname . I need to use a powershell to to go thru AD and pull into an exported csv file the results for each user  = samaaccount name, email , and display name. also there is one unique thing here , in order to get the correct name a match by last name needs to occur because I don't need to get all the , for example  smiths in the org , if the first name is joe smith in the csv I need to get joe smith and not Josephine smith
Jose Gabriel Ortega CCEO J0rt3g4 Consulting ServicesCommented:
I don't really understand your question
you have a csv with (name, lastname).

then you want to pull an exported csv file "the results of each user".
the result of what?

If you want to pull name and lastname in the first csv file, you need a 3rd column to be the matching parameter of something that you already have in the AD, like samaccountname.

with this 3 columns (name,lastname,samaccountname) you will be able to match the samaccountname to add name, lastname and displayname.
So you can get the samaccountname, email, displayname exported (to csv) from there.

gd6627Author Commented:
Ok let me see if I can explain it better I have a CVS file with first names and last names that I need to run thru powershell to check ad for them , then once it finds the match user by first name and last name give me the results of those users into another CVS file that will show the users display name samaccoutname and email

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now