im trying powershell remoting for some specific operatons on a remote computer and using wsman for the connection options.
WSManConnectionInfo connectionInfo = new WSManConnectionInfo(false, sharepointHost, 5985, "/wsman", "http://schemas.microsoft.com/powershell/Microsoft.PowerShell", new System.Management.Automation.PSCredential(admindata.Domain + "\\" + admindata.Admin, Helper.ToSecureString(admindata.Password))); connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Credssp; connectionInfo.ProxyAuthentication = AuthenticationMechanism.Negotiate;
normally it works fine but sometimes just before the runspace.open command is executed, the machine is pinging with its hostname and when the runspace.open is called, the machine doesnt ping with its hostname and my poweshell code fails with exception "machine not reachable"
then after 1 or 2 restarts it pings back and again at runspace.open it doesnt ping. please make a note that um using credssp as authentication mechanism so whenever i enable or disable WSMancredssp inshort whenever i run either commands in my powershell, the remote machine is again pinging with its hostname.
then after some hours it runs with no disturbance. and i dont have to bother about WSMancreddsp also
can any one tell me what could be the possible reason for it, is it with my local system or the remote system. Does it has anything to do with me enabling the Credssp thing???
please help me guys, im totally lost here.
PS: im running these commands on sharepoint server