Link to home
Start Free TrialLog in
Avatar of prashant06
prashant06

asked on

Get all users under Managed By in AD Group

Hi,

In Exchange 2010 distribution group, Group Information, Managed by, we can added multiple name in it. We would like to create a power shell to get a list of these users. Please advise how to do it. Thanks!
Avatar of Marwan Osman
Marwan Osman
Flag of Lebanon image

Get-DistributionGroup -ResultSize unlimited | Select-object Name,@{label=”ManagedBy”;expression={[string]($_.managedby | foreach {$_.tostring().split(“/”)[-1]})}},Primarysmtpaddress | export-csv “c:\managedby.csv”
I just tried it on my exchange 2013 and it works perfectly
see the script, it is ended with  export-csv “c:\managedby.csv”, so in C:\ you will get a CSV named managedby contains the result
{Can it filter out those records where MangedBy is empty}

it is another question and must be asked separately in a new question...
Avatar of prashant06
prashant06

ASKER

The managed by will have multiple user name. How to put in a separator, such as ;, between them?
run the script, it will arrange it in the same cell with comma
I already run the script but there is no comma in the ManagedBy field.
you are right, also I just run it and there is no comma, but it will list all the users who managed the group but without comma
can it be done? Since I want to generate a report to show who manage which group.
does it not helpful unless there is a comma between names?
the idea is to list all users who managed the groups regardless the comma, I am trying to find it out and include comma
ASKER CERTIFIED SOLUTION
Avatar of Marwan Osman
Marwan Osman
Flag of Lebanon image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial