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

Avatar of undefined
Last Comment
oBdA

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
oBdA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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
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
oBdA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck