Sunday, 10 July 2016

Get Manager Details from User objects in Active Directory

My today Post is about to get the user manager details from user object in Active Directory using PowerShell  (this was one requirement from my management for auditing purpose J)

Below powershell command will give you the list of user accounts and manager names which are associated with those user accounts.

Get-ADUser -Filter * -SearchBase 'Distinguish Path of the OU' -Properties manager | Export-CSV "ADUsers.csv"

EX : Get-ADUser -Filter * -SearchBase 'OU=Active users,OU=Test Users,DC=Test,DC=com' -Properties manager | Export-CSV "ADUsers.csv" 

Enjoy !!!

No comments:

Post a Comment