Import list of users - Export List of users and Groups
问题 Is there any way I can import a list of users, get their groups in AD and export the list? Import-Csv C:\Users.csv | % {Get-AdUser -filter "displayname -eq '$($_.username)'"} | Get-ADprincipalGroupMembership | Select samaccountname, name | Export-csv -path C:\UserPermiss.csv -NoTypeInformation File example: username Jon Jo Steve Price Alan Partridge Cheers. 回答1: In PSv4+ you can leverage the -PipelineVariable / -pv common parameter to make the output of an earlier pipeline stage available to