首页 文章

Powershell 4.0使用非管理域帐户进行远程处理

提问于
浏览
2

我正在寻找帮助,为一组服务器上的非管理员正确配置PowerShell远程处理 . 现在我们有一个工作配置,允许管理域帐户成功连接到服务器,没有错误 . 我们使用的身份验证方法是 Credssp ,使用 SSL ,这适用于域管理员帐户 .

另一方面,我有这个用户域帐户 userTest . 此帐户映射到本地(在每个服务器上)映射到 Remote Desktop User Groups 的域组 . 这允许此用户成功RDP到此服务器但没有管理员权限 . 它将保持这种状态,并且不能使它成为本地管理员 .

此用户的目的是允许非管理员帐户使用与域管理员帐户连接的 Restricted Session 对服务器执行一组脚本 . 当我尝试连接 userTest 帐户时出现问题 . 服务器响应 Access is Denied 错误:

[ServerA] Connecting to remote server ServerA failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (ServerA:String) [], PSRemotingTransportException + FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken

通过Analytic EventLogs我发现了一条错误消息,如下所示:

The WSMan service could not launch a host process to process the given request. Make sure the WSMan provider host server and proxy are properly registered.

这是我已经设置的配置:

  • 创建了一个名为RemoteDesktopUsers的PSSessionConfiguration

  • Register-PSSessionConfiguration -Name RemoteDesktopUsers -StartupScript C:\ Start.ps1

  • Set-PSSessionConfiguration -Name RemoteDesktopUsers -ShowSecurityDescriptorUI(在此SessionConfiguration中添加了 Remote Desktop Users 组)

所以是的,基本上来自我已经使用Google搜索,这应该是您需要能够使用非管理员帐户进行PSRemote的所有必要配置 . 正如我已经提到的,使用连接到此SessionConfiguration的域管理员帐户工作正常,所以我认为我缺少某种允许该用户访问的权限/权限/ SDDL:

Windows Server 2008 R2 SP1 Powershell 4.0 Winrm ProductVersion = OS:6.1.7601 SP:1.0 Stack:3.0

1 回答

  • 1

    You're probably running into this problem because of using CredSSP

    您必须使用CredSSP的任何特殊原因? CredSSP最常用的用途是,您需要将跳转服务器配置为从一台计算机远程连接到另一台计算机,再从那里再配置到另一台服务器 . 它众所周知的是Second-Hop功能,并且是一个巨大的安全漏洞,CredSSP有意识地配置它是一种痛苦 .

    您必须在三个位置配置CredSSP,一次在您要远程处理的计算机上,然后再在您将跳转到的计算机上,最后在您将从跳转服务器连接的每台计算机上 .

    如果你真的必须在The Scripting Guy的博客上使用CredSSP,follow this great guide here .

    If you don't need CredSSP

    使用Default / WSman授权尝试整个过程,我打赌问题会消失 .

相关问题