Guest User

Untitled

a guest
Mar 19th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. $Manager = Get-ADdirectReports -SamAccountName "ManagerName" | Select SamAccountName
  2. $Users = Get-AdUser -Filter * -Properties * | Select SamAccountName
  3.  
  4. Foreach ($User in $Users) {
  5. If ($User -Contains $Manager) {Write-Host $User reports to $Manager}
  6. Else
  7. {$User doesn't report to $Manager}
  8. }
Add Comment
Please, Sign In to add comment