PowerShell Genie

Get-LocalGroupMember

Use Get-LocalGroupMember to list the members of a local group, including domain accounts that belong to it.

Command 2 min read PowerShell 7 on Windows

Documentation: Microsoft Learn — PowerShell module reference

Syntax

1PS> Get-LocalGroupMember [-Group] <LocalGroup> [[-Member] <string>] [<CommonParameters>]
See the command anatomy

Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.

Get-LocalGroupMember [-Group] <LocalGroup> [[-Member] <string>] [<CommonParameters>]
  1. Stage 1Get-LocalGroupMember-Group -Member

    Try it

    Windows PowerShell

    PowerShell example · browser support is limited.

    Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.

    Interactive simulation · fictional data

    Examples

    Get-LocalGroupMember -Group Administrators

    1PS> Get-LocalGroupMember -Group Administrators | Select-Object Name, ObjectClass, PrincipalSource
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Name           ObjectClass  PrincipalSource
    -------------  -----------  ---------------
    Administrator
    svc_backup

    Get-LocalGroupMember -SID S-1-5-32-544

    1PS> Get-LocalGroupMember -SID S-1-5-32-544 # works on any language
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Name           Enabled  LastLogon
    -------------  -------  --------------------
    Administrator  True     9/10/2026 7:52:09 PM
    svc_backup     True     9/10/2026 2:00:15 AM

    Get-LocalGroupMember -Group "Remote Desktop Users"

    1PS> Get-LocalGroupMember -Group "Remote Desktop Users" | Select-Object Name, PrincipalSource
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Name           PrincipalSource
    -------------  ---------------
    Administrator
    svc_backup

    Parameters

    Parameter definitions:

    • -Group
    • -Member

    PowerShell module reference on Microsoft Learn

    Practical use and troubleshooting

    Practical scenario: Use Get-LocalGroupMember when you need to list the members of a local group, including domain accounts that belong to it. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.

    Common error and fix: Unresolved member SIDs can cause membership enumeration errors. Inspect the specific identity in the error and distinguish stale entries from a complete, successfully resolved member list. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.

    See also: Get-LocalGroup. Get-LocalGroupMember enumerates membership; Get-LocalGroup describes the group itself. Resolve the target group before treating its name as evidence of who has access. Read the linked command before substituting it; similar names do not imply identical inputs or output.

    Get-LocalGroupMember reference on Microsoft Learn

    Recap

    Get-LocalGroupMember Use Get-LocalGroupMember to list the members of a local group, including domain accounts that belong to it.

    Next: Get-ADGroupMember
    Genie guideGet-LocalGroupMember

    Use Get-LocalGroupMember to list the members of a local group, including domain accounts that belong to it. The console below is pre-loaded — run it, then change a value and run it again.