3

I need to know if it is possible to run powershell remotely in the following scenario:

I have a Windows XP box WITHOUT Powershell installed. From this box, I would like to run a PS script located somewhere like: \\mypc\C$\Scripts\information.ps1.

The script should be run against the machine where it resides. In this case, the “mypc” machine would be running the script and returning the result to the XP machine.

What makes this difficult is the fact that I cannot install Powershell or any third party apps on the Windows XP machine.

It’s a long shot but would this be doable?

Thanks!

3 Answers 3

5

While you can't actually run the script on the local machine without PS installed there, depending on what you want to actually accomplish you may be able to run it locally and simply access the remote resources. Most of a machine's resources are typically available remotely (File System, Registry, WMI, etc.) depending on the security on the machine.

EDIT: Now that my complete misunderstanding of the issue is cleared up, my answer would be: No, you do not need to have Powershell installed on a local machine to run a script on a remote machine that does have Powershell installed. Just use PSExec to kick off the Powershell process on the remote machine. I realize that the OP cannot install 3rd party apps, but there is absolutely no install associated with PSExec, it is a completely stand alone exe.

It has been a while since I had to do this so I did a quick check. This at the command line worked for me:

psexec \\REMOTEMACHINE "C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe" -File C:\temp\test.ps1 -NoProfile -NonInteractive
Sign up to request clarification or add additional context in comments.

8 Comments

Just to clarify a little, the script does not need to be run localy at all. I was looking for something that would allow the local machine to simply send a command or something to the remote PC and have it start the script there. Basicly, the script collects information on the remote machine and I would like to be able to run that script without logging on to that machine.
That is what I am saying. Depending on the information that you want to collect, just run the script on your local machine and collect the information from the remote machine. You do not need PS installed on the remote machine for that. So for instance if you wanted to know the size of the remote machine's C drive, you could run this on your local machine: (gwmi win32_logicalDisk -Computer [REMOTECOMPUTERNAMEHERE]| ?{$_.DeviceID -eq 'C:'}).Size
I see where the confusion is. Unfortunately, my local machine is the one w/o Powershell which means even though my remote machine does have Powershell, I cannot communicate with it in the way that I wanted to. Thank you for the assistance.
Oh...if the remote machine does have PS on it then yes you most definitle can run a script there. Just use PSExec to kick off the script on the remote machine.
And to be clear, PSExec is a third party executeable, but there is no istallation involved. It is a standalone exe.
|
1

You need to have Powershell installed. This isn't possible :(. Sorry.

Comments

0

Using Psexec is the only way I can think of too. However, if you are using PSexec.exe using alternate credentials, the credentials are passed over the network in plaintext. Something to be wary about if your network is visible to other people.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.