Set-LocalGroup
更改本地安全组。
语法
Set-LocalGroup
-Description <String>
[-InputObject] <LocalGroup>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-LocalGroup
-Description <String>
[-Name] <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-LocalGroup
-Description <String>
[-SID] <SecurityIdentifier>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Set-LocalGroup
cmdlet 更改本地安全组。
示例
示例 1:更改组说明
Set-LocalGroup -Name "SecurityGroup04" -Description "This is a sample description."
此命令更改本地组的说明。
注意
Microsoft.PowerShell.LocalAccounts 模块在 64 位系统上的 32 位 PowerShell 中不可用。
参数
-Confirm
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Description
指定组的注释。 最大长度为 48 个字符。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-InputObject
指定此 cmdlet 更改的安全组。 若要获取安全组,请使用 Get-LocalGroup cmdlet。
类型: | Microsoft.PowerShell.Commands.LocalGroup |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
指定此 cmdlet 更改的安全组的名称。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-SID
指定此 cmdlet 更改的安全组的安全 ID (SID)。
类型: | SecurityIdentifier |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | False |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
System.Management.Automation.SecurityAccountsManager.LocalGroup
可以通过管道将安全组传递给此 cmdlet。
可以通过管道将字符串传递给此 cmdlet。
可以通过管道将 SID 传递给此 cmdlet。
输出
None
此 cmdlet 不返回任何输出。
备注
Windows PowerShell 包含以下 Set-LocalGroup
别名:
slg
PrincipalSource 属性是 用于描述对象的源的 localUser、LocalGroup和 LocalPrincipal 对象的属性。 可能的源如下所示:
- 当地
- Active Directory
- Microsoft Entra 组
- Microsoft 帐户
PrincipalSource 仅受 Windows 10、Windows Server 2016 和更高版本的 Windows作系统支持。 对于早期版本,该属性为空。