Import-Csv Y:\Temp\list2.csv | foreach {
Get-QADUser -lastname $_.lastname -firstname $_.firstname | select firstname,lastname,mobile,primarysmtpaddress,logonname
} | Export-Csv c:\list3.csv
Exporting data from a foreach loop (Get-QADUser)
-
27-11-2021 - |
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
}
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow