Solved

Pull missing information from CSV file in Powershell then export

Posted on 2011-09-28
1
593 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 71

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 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