Get the App
SLTechnology News&Howtos  ›  Servers  › 

Powershell exports the properties of the AD account specified in the CSV file

Shulou Source: shulou.com Published: 2022-06-03 04:01:56 10月03日 Update

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:

Tags: User attribute time demand usage Information Public account more user name Information demand side Middle finger document account Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL Linux Xiaomi Microsoft