One of my customers have a set of access groups set up for access to network shares. These all list a user in the Managed By field, because said user is the one who can approve or deny requests for access to these shares. I needed to get a list of all the groups and their owners. Here’s how I went about it.
The first thing I needed to do, was find all the groups. Helpfully, they all conform to the same naming convention, so that was easy enough. Here’s what that looked like:
get-adgroup -filter {name -like "Naming-Convention*"}
By specifying that I wanted it to display the Managed By user, I got a list that was good enough to get going with. Here’s what that looked like:
get-adgroup -filter {name -like "Naming-Convention*"} -properties ManagedBy
The results, however, didn’t look all that tidy, and I like handing tidy lists over to my customers whenever possible. My first attempt was to take the filtered results, and select the group name and Managed By user. Here’s how that looked:
get-adgroup -filter {name -like "Naming-Convention*"} -properties ManagedBy | select SamAccountName, ManagedBy
That looked much tidier, and gave me something I could give to my customer.
By posting a comment, you consent to our collecting the information you enter. See privacy policy for more information.