我在远程执行脚本时遇到了问题,因为目标服务器上的非管理员。非管理员的远程PowerShell执行
这是我试图运行脚本的一部分:
New-PSSession -computername ServerA.DomainA.org -Credential $LoginCredentials
$PSServerA = Get-PSSession -computername bl ServerA.DomainA.org
Invoke-Command -Session $PSServerA -scriptblock {Add-PSSnapin Quest.ActiveRoles.ADManagement}
我得到以下错误:
The following error occurred while loading the extended type data file: Quest.ActiveRoles.ADManagement, C:\Program Files\Quest Software\Management Shell for AD\Quest.ActiveRoles.ADManagement.Types.ps1xml : File skipped because of the following validation exception: AuthorizationManager check failed..
这是一个帐户创建脚本我的一小部分写作。我希望帮助台能够执行脚本,并且他们不是目标服务器上管理员组的成员,尽管他们是服务器运营商组的成员。我可以以他们的身份登录到目标服务器,并从标准(非管理员)PowerShell提示符下,我可以成功运行Add-PSSnapin命令。
目标服务器上的ExecutionPolicy是Unrestricted。
我给了用户执行权限到默认的microsoft.Powershell远程会话配置,这是成功的,因为他们可以打开会话。
所以我的问题是我需要什么权限来分配用户才能让他们远程执行命令?
你可以运行'Invoke-Command -Session $ PSServerA -scriptblock {get-executionpolicy}'获得$ PSServer会话的有效executionpolicy吗? –