Tinus EngOps Wiki

Logo

OpsaC - Operating as PowerShell code

Links

Home

IT-Wiki

PowerShell Blog

PowerShell Index

PowerShell Search

Additional Websites

View my GitHub Profile

View my GitHub Gists

View my Codeberg Page

View my Photo Website

Group Membership

published: November 10, 2020 author: Tinu tags: PowerShell categories: PowerShell-Active-Directory


Table of Contents

GroupMembership

The Get-ADPrincipalGroupMembership cmdlet gets the Active Directory groups that have a specified user, computer, group, or service account as a member. This cmdlet requires a global catalog to perform the group search. If the forest that contains the user, computer, or group does not have a global catalog, the cmdlet returns a non-terminating error.

@{$($env:USERNAME)=(Get-ADPrincipalGroupMembership -Identity $env:USERNAME | Select -ExpandProperty Name)}

Name            Value
----            -----
MyAccount       {Domain Users, Remote Desktop Users}

See also

Get-ADPrincipalGroupMembership on Microsoft Docs.


← Previous Post ◇ [ Top ] ◇ Copyright © 2024 by tinuwalther ◇ [ Blog ] ◇ Next Post →