Get-LocalGroupMember

Get-LocalGroupMember

Module:

Microsoft.PowerShell.LocalAccounts

Gets members from a local group.

Syntax

PowerShellCopy

Get-LocalGroupMember
   [[-Member] <String>]
   [-Name] <String>
   [<CommonParameters>]

PowerShellCopy

Get-LocalGroupMember
   [-Group] <LocalGroup>
   [[-Member] <String>]
   [<CommonParameters>]

PowerShellCopy

Get-LocalGroupMember
   [[-Member] <String>]
   [-SID] <SecurityIdentifier>
   [<CommonParameters>]

Description

The Get-LocalGroupMember cmdlet gets members from a local group.

 Note

The Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit system.

Examples

Example 1: Get all members of the Administrators group

PowerShellCopy

PS C:\> Get-LocalGroupMember -Group "Administrators"
ObjectClass Name                    PrincipalSource
----------- ----                    ---------------
User        CONTOSOPC\Administrator Local
User        CONTOSOPC\LocalAdmin    Local

This command gets all the members of the local Administrators group.

Parameters

-Group

Specifies the security group from which this cmdlet gets members.

TABLE 1
Type:Microsoft.PowerShell.Commands.LocalGroup
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-Member

Specifies a user or group that this cmdlet gets from a security group. You can specify users or groups by name or security ID (SID). Specify SID strings in S-R-I-S-S . . . format. You can use wildcard characters. If you do not specify this parameter, the cmdlet gets all members of the group.

TABLE 2
Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the security group from which this cmdlet gets members.

TABLE 3
Type:String
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-SID

Specifies the security ID of the security group from which this cmdlet gets members.

TABLE 4
Type:SecurityIdentifier
Position:0
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

Inputs

System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier

You can pipe a local group, a string, or a SID to this cmdlet.

Outputs

Microsoft.SecurityAccountsManager.LocalPrincipal

This cmdlet returns local principals.

Notes

  • The PrincipalSource property is a property on LocalUserLocalGroup, and LocalPrincipal objects that describes the source of the object. The possible sources are as follows:
  • Local
  • Active Directory
  • Azure Active Directory group
  • Microsoft Account

PrincipalSource is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值