Powershell exports the properties of the AD account specified in the CSV file
Sometimes when we export AD user attributes, we do not need to export all users, we may only need to export the attribute information of users in a specific user list. For the user list provided by the demand side, we can put the user name in the CSV. Read attributes one by one # export all user attributes in CSV $username=Import-Csv C:\ userinfo.csvforeach ($I in $username) {Get-ADUser $i.name-Properties * | `user c:\ alluser.csv-NoTypeInformation-Encoding Default} # Export some user attributes in CSV $username=Import-Csv C:\ userinfo.csvforeach ($I in $username) {Get-ADUser $i.name-Properties * | select SamAccountName,Name,Department | `Export-Csv c:\ alluser.csv-NoTypeInformation-Encoding Default}
Welcome to scan my official Wechat account for more IT information: