Hi,
You will use the following commands:
Export-Csv
https://video2.skills-academy.com/en-us/powershell/module/microsoft.powershell.utility/export-csv?view=powershell-7
Import-Csv
https://video2.skills-academy.com/en-us/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7
Get-ADUser
https://video2.skills-academy.com/en-us/powershell/module/addsadministration/get-aduser?view=win10-ps
Get-ADComputer
https://video2.skills-academy.com/en-us/powershell/module/addsadministration/get-adcomputer?view=win10-ps
About you want to reflect the specific value (Department) of the registered account property in CSV.
First of course,you need get the specific user\computer that you are looking for.
Then,use command Get-ADUser -filter * -Properties Department | select name,Department .This command will help you find all AD users, and then filter out their Deparment attributes.
Or
Get-ADcomputer -filter * -Properties Department | select name,Department.
Then you can use Export-Csv -path c: ,Export as a CSV file, the path is c:
Of course, you can also modify the above commands according to your needs.
If you need further help, please let us know
CSV batch registration method using Powershell of Active Directory user account property (Department)
K G
1
Reputation point
In Active Directory, I want to reflect the specific value (Department) of the registered account property in CSV with PowerShell using PowerShell. (If possible, please tell me the sentence of the completed command)
Commands on Powershell and contents to be written in CSV when creating CSV
I want to confirm.
It would be very helpful if you could teach me. Thank you.
1 answer
Sort by: Most helpful
-
Young Yang (Shanghai Wicresoft Co,.Ltd.) 661 Reputation points
2020-08-05T06:00:17.837+00:00