Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pull missing information from CSV file in Powershell then export

Posted on 2011-09-28
1
Medium Priority
?
607 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 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

609 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