Solved

Pull missing information from CSV file in Powershell then export

Posted on 2011-09-28
1
574 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

706 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

19 Experts available now in Live!

Get 1:1 Help Now