Run the following in PowerShell changing the path at the end to suit your needs, the output can then be sorted by the Manager column in Excel.
get-aduser -Filter * -Properties Manager | Select-Object Name,sAMAccountName,Manager | export-csv C:\Scripts\UsersWithManagers.csv -notypeinformation
No comments:
Post a Comment