Solved

Pull missing information from CSV file in Powershell then export

Posted on 2011-09-28
1
580 Views
Last Modified: 2012-08-13
I have a CSV file that has firstname, lastname and need to grab the email address associated using powershell.

CSV = firstname, lastname

Import to Powershell, Find email address based on lastname, export data (firstname, lastname, email)
0
Comment
Question by:rsn-helpdesk
1 Comment
 
LVL 70

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 36814094
What do you have available to search Active Directory? Quest CmdLets? MS AD CmdLets? Nothing at all? :)

If you had Quest's CmdLets it would go like this:
Import-Csv "YourFile.csv" | ForEach-Object {
  Get-QADUser -FirstName $_.firstname -LastName $_.lastname
} | Select-Object FirstName, LastName, Email |
  Export-Csv "YourOutputFile.csv" -NoTypeInformation

Open in new window

Chris
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now