管理员组中的用户无法使用 PowerShell 远程处理执行管理任务,只有管理员可以

Pey*_*man 4 powershell user-permissions user-accounts windows-server-2016

我正在使用 Windows Server 2016(工作组)并在其上启用了 powershell 远程处理。只有默认管理员帐户才能执行需要管理权限的任务,例如

Get-Service
Get-DnsServerZone
Run Code Online (Sandbox Code Playgroud)

当我这样做时,我收到错误access denied 。我可以使用 powershell 远程连接到它并执行一些类似的操作get-process

备注:无论我创建什么用户(是的,我将它们添加到管理员组)。我也将其添加到远程管理用户中。我使用 Hyper-V 沙箱虚拟机执行此操作,但它在我的生产服务器中根本不起作用。我还尝试通过在 PSSessionConfiguration 的 SDDL 权限中添加特定用户 SID 来修复它,但它也不起作用。这是 PSSessionConfiguration (我使用的用户名是despot,服务器名称是phantom12

Name          : microsoft.powershell
PSVersion     : 5.1
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, BUILTIN\Remote
                Management Users AccessAllowed, phantom12\despot AccessAllowed

Name          : microsoft.powershell.workflow
PSVersion     : 5.1
StartupScript :
RunAsUser     :
Permission    : BUILTIN\Administrators AccessAllowed, BUILTIN\Remote Management Users AccessAllowed, phantom12\despot
                AccessAllowed

Name          : microsoft.powershell32
PSVersion     : 5.1
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, BUILTIN\Remote
                Management Users AccessAllowed

Name          : microsoft.windows.servermanagerworkflows
PSVersion     : 3.0
StartupScript :
RunAsUser     :
Permission    : NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, phantom12\despot
                AccessAllowed
Run Code Online (Sandbox Code Playgroud)

这是我在 WSMAN 服务部分修改的 SDDL 字符串(我添加的 SID 是用户 SID,而不是其组)

O:NSG:BAD:P(A;;GA;;;LA)(A;;GA;;;BA)(A;;GA;;;S-1-5-21-xxxxxxxxx-xxxxxxxxxx-xxxxxxxxxx-1000)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
Run Code Online (Sandbox Code Playgroud)

令人沮丧的是,我可以使用虚拟机执行此操作并更改权限,但它无法在我的生产服务器上运行,而且我不想重新安装 Windows。即使我添加了它们,它们也没有被添加到管理员组。

提前谢谢大家!

Har*_*ton 5

此行为是设计使然,但可以通过更改注册表设置来禁用。

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Run Code Online (Sandbox Code Playgroud)

查找或创建该DWORDLocalAccountTokenFilterPolicy并将其设置为 1。然后您可能需要重新启动。

这将允许远程连接(包括 Powershell 远程处理)拥有不受限制的管理员访问权限,而不会产生完全关闭 UAC 的不良副作用。