Link to home
Start Free TrialLog in
Avatar of Alex
AlexFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Get contacts from distribution groups

Afternoon all,

I need to find any contacts in any distribution groups from AD. I know that Get-adgroupmember doesn't return contacts and I'm unsure as to the best way forward.

Get-ADObject -Filter {(objectclass -eq 'group')} -Properties Member

Open in new window


I know that'll pull the members within an object but it won't filter out only contacts. Any idea how to go about this? I've had a search and not found anything that filters contacts before the output.

Thanks
Alex
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

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
Avatar of Alex

ASKER

Ahhhh

Makes sense now, I knew I needed to use the get-adobject but I couldn't figure out the best way, as always thank you for your help.


Thanks
Alex
Avatar of Alex

ASKER

ACtually

oBdA, could you tell me how I can get it to reference the group that it's found the contact in??? I was wrong, we do have contacts in groups (it just came through)

I can then output it to a CSV

Thanks
Alex
EXPERT CERTIFIED SOLUTION
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