I have two remote machines: 1 we call it the driver, 2 we call it the client. They are in the same domain let's call them "TECH.com".
On the driver machine, I have a PowerShell script that controls the client machine: 1, restore checkpoint on the client. 2, stop the client. 3, start the client. etc. The thing I am trying to do is to make the client machine execute another PowerShell script (which can reside on either/both the client or/and the driver. I can copy the file from the driver to the client if necessary) on the client machine.
So I have done some research, and found two methods: 1, WS Management. 2, WMI I have enabled-psremoting on both machines. I have test WsMan on both machines and they see to work fine I have been able to transfer files between these two machines However, when I tried to run Invoke-command, it gave me errors:
Connecting to remote server XXXXXXtech.com failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090311 occurred while using Kerberos authentication: There are currently no logon servers available to service the logon request. Possible causes are: -The user name or password specified are invalid. -Kerberos is used when no authentication method and no user name are specified. -Kerberos accepts domain user names, but not local user names. -The Service Principal Name (SPN) for the remote computer name and port does not exist. -The client and remote computers are in different domains and there is no trust between the two domains. After checking for the above issues, try the following: -Check the Event Viewer for events related to authentication. -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport. Note that computers in the TrustedHosts list might not be authenticated. -For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (XXXXXX.XXXXtech.com:String) , PSRemotingTransportException + FullyQualifiedErrorId : AuthenticationFailed,PSSessionStateBroken