Question

How can i write a powershell script that opens and runs cmdlets on a 64bit remote powershell executable.

I am having a tough time finding any resources, examples or tutorials that show how to write a powershell script that connects to a remote server, opens up the 64-bit Powershell.exe and runs cmdlets from it. I will be running this script from a 32-bit machine. If anyone has any examples or ideas ?

Update:

I have found that i can on the remote machine first execute a trusted host command and enable remote-ps

Enable-PSRemoting
cd wsman:
cd localhost\client
set-item trustedhosts *

After doing this, my attempt to connect to my server

Enter-PSSession servername

gives this error

The following error occured while using Kerberos authentication: The network path was not found.
Was it helpful?

Solution

If a 64-bit machine has PowerShell remoting configured, the default PowerShell endpoint will be 64-bit. There is also an x86 endpoint registered, but that is not the default.

In regards to the updated question, what type of environment are you in? Workgroup or domain?

If you are in a domain, things are a bit simpler. If both sides have enabled PowerShell remoting (via Enable-PSRemoting), You should be able to Enter-PSSession servername as you attempted. Do you have administrative rights on the remote machine?

Since Kerberos was failing you can specify other authentication types using the -Authentication parameter. Valid options are NTLM, CredSSP, and Kerberos. The default is Negotiate, which might use Kerberos or NTLM.

You can specify specific credentials with the -Credential parameter.

In regards to the Kerberos error, you might want to check if the host has the proper SPN's registered.

Don Jones and Tobias Weltner authored a great guide to PowerShell Remoting - Found Here It walks through a number of the configuration scenarios for PowerShell Remoting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top