获取本地相关的命令指集

Get-Command -name *local*

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Add-LocalGroupMember                               1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Disable-LocalUser                                  1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Enable-LocalUser                                   1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Get-LocalGroup                                     1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Get-LocalGroupMember                               1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Get-LocalUser                                      1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          New-LocalGroup                                     1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          New-LocalUser                                      1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Remove-LocalGroup                                  1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Remove-LocalGroupMember                            1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Remove-LocalUser                                   1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Rename-LocalGroup                                  1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Rename-LocalUser                                   1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Set-LocalGroup                                     1.0.0.0    Microsoft.PowerShell.LocalAccounts
Cmdlet          Set-LocalUser                                      1.0.0.0    Microsoft.PowerShell.LocalAccounts

获取本地管理员组

Get-LocalGroup administrators

Name           Description
----           -----------
Administrators 管理员对计算机/域有不受限制的完全访问权

获取本地管理员组成员

Get-LocalGroupMember administrators

ObjectClass Name                      PrincipalSource
----------- ----                      ---------------
组          HXX\Domain Admins         ActiveDirectory
用户        HXX\hexingxing            ActiveDirectory
用户        S2MQT22HH7N\Administrator Local

获取本地用户组

Get-LocalGroup users

Name  Description
----  -----------
Users 防止用户进行有意或无意的系统范围的更改,但是可以运行大部分应用程序

获取本地用户组成员

Get-LocalGroupMember users

ObjectClass Name                             PrincipalSource
----------- ----                             ---------------
组          HXX\Domain Users                 ActiveDirectory
组          NT AUTHORITY\Authenticated Users Unknown
组          NT AUTHORITY\INTERACTIVE         Unknown

0 条评论

发表评论

Avatar placeholder

您的电子邮箱地址不会被公开。