Solved

Powershell command/script to list all users who have a given manager.

Posted on 2012-03-22
4
614 Views
Last Modified: 2012-03-22
I need a way to list all the users of a given manager. It can be a native powershell or using QAD tools.

Here is what I tried?

$Mgr = Get-Qaduser MyManager
get-qaduser | where {$_.Manager -eq $Mgr}

But that did not return any results.
0
Comment
Question by:Gary Dewrell
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Dan Arseneau earned 500 total points
ID: 37754388
Try..

Get-User -ResultSize unlimited | where {$_.manager -match "name"}

Open in new window

0
 
LVL 27

Expert Comment

by:KenMcF
ID: 37754477
I would not use that filter
"Get-User -ResultSize unlimited | where {$_.manager -match "name"}"

What this is doing is pulling every single user in your AD and then piping to the where. If you have a large AD env this will take awhile


Use this

Get-Qaduser -manager USERNAMEOFMANAGER
0
 
LVL 27

Expert Comment

by:KenMcF
ID: 37754486
ANd to add to your original. It was not working becuase it is looking for a DN

SO this would work but very inefficient



$Mgr = (Get-Qaduser MyManager).DN
get-qaduser | where {$_.Manager -eq $Mgr}
0
 
LVL 12

Author Closing Comment

by:Gary Dewrell
ID: 37754489
Thanks!
0

Join & Write a Comment

In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
Synchronize a new Active Directory domain with an existing Office 365 tenant
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now