Question

I would like output from the following snippet as a text file. How do I accomplish this?

$users = Import-Csv Y:\Temp\list2.csv

foreach ($user in $users) {
    Get-QADUser -lastname $user.lastname -firstname $user.firstname | select firstname,lastname,mobile,primarysmtpaddress,logonname 
}
Was it helpful?

Solution

Import-Csv Y:\Temp\list2.csv | foreach {
    Get-QADUser -lastname $_.lastname -firstname $_.firstname | select firstname,lastname,mobile,primarysmtpaddress,logonname 
} | Export-Csv c:\list3.csv
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top