Forum Discussion
SS9911
Sep 07, 2023Copper Contributor
Get users from CSV, foreach user, get country, name, etc., then Export
Hi! I have a problem with PS query. I have a CSV file with +1000 userprincipalname. Id like to export that UPN and for each user get info like userprincipalname, title, country, department, enabled...
FranciscoNabas
Sep 07, 2023Copper Contributor
Take a look at the 'Import-Csv', 'Export-Csv' Cmdlets. they do all the heavy lifting for you. Then you can use 'Select-Object' to select the properties you want.
https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv
https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/import-csv