列出本机全部用户组(Get-LocalGroup)
一条命令查看电脑上所有用户组:Administrators、Users、Guests 等,分配权限前先摸清分组。
在 PowerShell 中运行 `Get-LocalGroup | Select-Object Name, Description` 即可列出所有本地用户组。
01命令
命令
$ Get-LocalGroup | Select-Object Name, Description02作用说明
Windows 主要通过组来决定账号能做什么,所以在给用户加组之前,先看看这台机器上到底有哪些组很有帮助。Get-LocalGroup 会列出全部组及其描述——Administrators、Users、Guests、Remote Desktop Users,以及软件安装时创建的自定义组。想看某个组里有哪些成员,再配合 Get-LocalGroupMember 查询即可。
03风险
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- Get-LocalGroupMember cmdlet | Microsoft Learn依据: Get-LocalGroupMember lists the members of a specific local group, complementing the group listing from Get-LocalGroup.
- Get-LocalGroup cmdlet | Microsoft Learn依据: Get-LocalGroup lists the local security groups on the computer, exposing Name and Description.
最后验证: 2026-09-19 · 分类: 安全与隐私