0

我想将以下代码段的输出作为文本文件。我该如何做到这一点?

$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 
}
4

1 回答 1

1
Import-Csv Y:\Temp\list2.csv | foreach {
    Get-QADUser -lastname $_.lastname -firstname $_.firstname | select firstname,lastname,mobile,primarysmtpaddress,logonname 
} | Export-Csv c:\list3.csv
于 2012-11-07T10:45:44.717 回答