【发布时间】:2011-09-05 14:59:18
【问题描述】:
为了自动化测试发布,我需要访问其他域组中的远程计算机。 我在远程计算机上做了什么:
- 运行 Enable-PSRemoting
- 设置 TrustedHosts "*"
- 添加了带有自签名证书的 https 侦听器
- 开放 5985 和 5986 端口
所以现在脚本通过 PowerShell 控制台成功运行。 但是当我尝试通过 TeamCity 代理运行远程脚本时,我收到了以下错误:
Connecting to remote server failed with the following error message :
Access is denied. For more information, see the
about_Remote_Troubleshooting Help topic.
TeamCity 代理服务正在使用本地系统权限运行。
会话初始化
$password = ConvertTo-SecureString $appServerPwd -AsPlainText -Force
$appCred = New-Object System.Management.Automation.PsCredential($appServerUser,$password)
$rs = New-PSSession -ComputerName $appServer -Credential $appCred -UseSSL -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck) -Authentication Negotiate
当我尝试通过 TeamCity 远程调用域计算机时,一切正常。 你知道如何解决这个问题吗?
迪玛
【问题讨论】:
-
远程计算机运行Windows Server 2003,客户端运行Vista
标签: powershell powershell-remoting