Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Manager = Get-ADdirectReports -SamAccountName "ManagerName" | Select SamAccountName
- $Users = Get-AdUser -Filter * -Properties * | Select SamAccountName
- Foreach ($User in $Users) {
- If ($User -Contains $Manager) {Write-Host $User reports to $Manager}
- Else
- {$User doesn't report to $Manager}
- }
Add Comment
Please, Sign In to add comment