Reputation: 51
In order to automate test releases, I need access to remote computer in other domain group. What I've done on remote computer:
So now scripts are running successfuly via PowerShell console. But when I'm trying to run remote script via TeamCity agent I've been receiving following error:
Connecting to remote server failed with the following error message :
Access is denied. For more information, see the
about_Remote_Troubleshooting Help topic.
TeamCity agent service is running with Local System rights.
Session initialization
$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
Also when I'm trying to make remote call to domain computer via TeamCity everything works. Do you have any idea how to solve this issue ?
Dima
Upvotes: 1
Views: 9094
Reputation: 51
I've found the problem, as soon I changed "Local System" user to Administrator user on TeamCity agent service, everything started to work. So the issues was in rights (starting PSSesion) between "Local System" and Administrator.
Upvotes: 3