I’m writing a Powershell script to mess with some Active Directory data. I need a way to see if a user (based on the user’s SAM Account Name) is a member of any groups or not. All other things I’ve seen are “how to see the members of a group” or “how to list all members not in a specific group”, what I need is to see, as a boolean, if a specific user is part of any groups at all or not. I’m also very new to Powershell and Active Directory, so dumbed-down answers would be appreciated.
I’ve tried a bunch of similar solutions here on Stack Overflow, and none have worked.