Need help on Powershell command - how to extract all users,groups and contacts in a ADgroup

Chatta, Antara 21 Reputation points
2021-06-24T15:54:55.543+00:00

Need help on Powershell command - how to extract all users,groups and contacts in a ADgroup

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2021-06-25T01:29:50.1+00:00

    Hi,

    Please try this

    $group = "CN=testgroup,OU=testOU,DC=contoso,DC=com"  
    Get-ADObject -Filter "memberof -eq '$group'"  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2021-06-24T18:29:00.113+00:00

    Use the Get-ADGroupMember cmdlet.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.