小编Bun*_*nyk的帖子

如何允许非管理员用户访问 winrs?

我有 Windows Server 2012(和 Server 2008,但它是下一个优先级)来使用txwinrm监视它。txwinrm 库内部使用的是 WinRS 协议。我必须使用最低权限的用户来监视它,但不知道如何为他配置访问权限。

我设法做的就是为我的用户配置远程 Powershell 会话,但看起来 winrs 和 powershell 会话具有不同的安全描述符:

Invoke-Command -ComputerName 192.168.173.206 -Credential (credential Administrator $pwd) -ScriptBlock { 2 + 2}
# gives 4
Invoke-Command -ComputerName 192.168.173.206 -Credential (credential lpu1 $pwd) -ScriptBlock { 2 + 2}
# gives 4
winrs -r:192.168.173.206 -u:Administrator -p:$pwd 'powershell -command "2+2"'
# gives 4
winrs -r:192.168.173.206 -u:lpu1 -p:$pwd 'powershell -command "2+2"'
# Gives Winrs error: Access is denied.
Run Code Online (Sandbox Code Playgroud)

我的用户的配置如下:

(Get-Item WSMan:\localhost\Service\RootSDDL).value
# O:NSG:BAD:P(A;;GA;;;BA)(A;;GA;;;S-1-5-21-3231263931-1371906242-1889625497-1141)S:P(AU;FA;GA;;;WD)(AU;SA;GWGX;;;WD)
(Get-PSSessionConfiguration -name Microsoft.Powershell).SecurityDescriptorSddl …
Run Code Online (Sandbox Code Playgroud)

windows powershell remoting winrm

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

powershell ×1

remoting ×1

windows ×1

winrm ×1