AutoSPInstaller – Warning: Couldn’t create remote session to SERVERNAME; trying again
I’ve now used AutoSPInstaller to build multi-server farms several times, and often come across new issues (not the fault of AutoSPInstaller, I should add). Today the script has got stuck in a loop when trying to provision the User Profile Service on a remote Windows 2012R2 server:
– Creating User Profile Service Applicaton…
– Enabling remoting to <servername>
– Creating temporary "remote" session to <servername>…
WARNING: Couldn’t create remote session to <servername>; trying again…
Other people have suggested the following, but none of them resolved the issue for me:
- Run ‘Enable-PSRemoting -SkipNetworkProfileCheck -Force’ on the remote servers
- Run ‘Set-Item WSMan:\localhost\client\trustedhosts * -Force
I have so far found no solution to this, other than to run AutoSPInstaller on the remote computer then quickly end it before it attempts to connect to other remote servers. Other suggestions welcome!
Hey,
Had the same issue. Debugged it in Powershell ISE, below is the error (shortened)
Had issue in lab farm so not concerned about server names being published ect.
Farm consists of:
SP2016-APP, SEARCH, WFE, SQL
New-PSSession : [SP2016-WFE] Connecting to remote server SP2016-WFE failed with the following error message : The WinRM client cannot process the request. A computer policy does not allow the delegation of the user credentials to the target computer.
Use gpedit.msc and look at the following policy: Computer Configuration -> Administrative Templates -> System -> Credentials Delegation -> Allow Delegating Fresh Credentials. Verify that it is enabled and configured with an SPN appropriate for the
target computer. For example, for a target computer name “myserver.domain.com”, the SPN can be one of the following: WSMAN/myserver.domain.com or WSMAN/*.domain.com. For more information, see the about_Remote_Troubleshooting Help topic.
gpedit.msc
Computer Configuration -> Administrative Templates -> System -> Credentials Delegation -> Allow Delegating Fresh
added WSMAN/sp2016-WFE and WSMAN/*.splab.local to WFE and repeated on APP server with sp2016-APP and *.splab.local
Had to reboot servers (WFE and APP) before it started working.
farm account (sp_farm) needs to be a local admin otherwise you get this error
New-PSSession : [SP2016-WFE] Connecting to remote server SP2016-WFE failed with the following error message : Access is denied.
also ran the cmdlets in your post so not sure if that helped or not. I did that before investigating this.
debugged line: 3582 of AutoSPInstallerFunctions.ps1 to figure it out.
$UPSession = New-PSSession -Name “UPS-Session” -Authentication Credssp -Credential $farmCredential -ComputerName $env:COMPUTERNAME -ErrorAction SilentlyContinue