CSV batch registration method using Powershell of Active Directory user account property (Department)

K G 1 Reputation point
2020-07-31T02:23:54.7+00:00

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.

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,149 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. 2020-08-05T06:00:17.837+00:00

    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

    0 comments No comments