Forum Discussion
Mark Louie Diaz
Aug 29, 2018Copper Contributor
Get mailcontact if member of any group
Hi Tech Community, May I ask how can I accomplish the subject? I want to know before removing a mail contact if it is a member of a Distribution group. Best Regards, Mark
Dominique0473
Feb 04, 2020Copper Contributor
I am working on the same ask. Mark Louie Diaz
Did you find a resolution?
wskonieczny
Sep 13, 2022Copper Contributor
This works for me:
Get-ADObject -LDAPFilter '(&(objectclass=contact)(!(memberof=*)))' -Server dc01 -SearchBase 'OU=Contacts,OU=Company,DC=work,DC=com' -Properties name