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
Joshua Bines
Mar 26, 2019Iron Contributor
VasilMichevthe need for speed? try this...
Get-ADObject -LDAPFilter "(&(objectCategory=contact)(objectClass=contact)(memberOf=*))" -Properties Name,MemberOf,CanonicalName | ft Name,CanonicalName,memberof -wrap
ZK4568746
Oct 21, 2022Copper Contributor
Utilizing the LDAP FIlter was smart, it allowed me to act against just the ADObjects that were Contacts with existing group memberships without rewriting the entire script. Thanks!