How to check if a specific AD account belongs to a AD group from list? RRS feed

  • Question

  • Hello All!

    I'm wondering if there is a powershell script to check a specific account from belongs to a certains groups (list of groups in CSV format). For the purpose of my lab the following command sequence does not works for that.

    Get-ADPrincipalGroupMembership -identity user1 | select samaccountname

    The idea is to make the inverse, export all groups of the domain and check if the user belongs to them. Why? the reason is the user is not member of the domain where the groups are.

    I hope you can give me a hand, thank you in advance.

    • Moved by Bill_Stewart Wednesday, September 4, 2019 6:11 PM This is not "scripts on demand"
    Wednesday, February 27, 2019 7:44 PM

All replies

  • Your question is very hard to understand as the grammar is very bad.  Rethink the question or get someone to help you with the translation.

    Also note that we do not do homework for students.  If you are having issues please talk to you instructor that is wht theya re there for.

    To check accounts use "Get-AdGroupMember"

    help Get-AdGroupMember -online
    help where-object -online


    Wednesday, February 27, 2019 8:19 PM