5

This is as close to the exact question that I have, but looks like he found another way that fits the needs so it has been marked as answered:

I have a Powershell script running on server A that I want to launch a different Powershell script on server B.

The script on server B will run fine if I run it locally, but it has to be launched as if by the Run as Administrator option. I can't find a way to launch the script on server B from server A that won't give me a permissions issue.

So far, I've tried:

  • invoke-command using a PScreds object with the local admin account
  • start-process throw a PSSession using the -Verb runas flag modifying the server B script to "Self elevate", but it still fails from A
  • creating a batch file wrapper with Start-process

Is there another way to try that I haven't come up with? The purpose, (in case someone has an all-around better way) is to kick off Windows Updates on server B from server A. I want to be able to do this on demand and not have a Scheduled Task that I'll eventually forget about and have trigger when I don't want it to.

0

2 Answers 2

1

Is using psexec.exe an option? If so you can use it with the -h parameter.

If the target system is Vista or higher, has the process run with the account's elevated token, if available.

0

I'd be tempted to make a call to SCHTASKS.EXE, and use its /RL HIGHEST option. I appreciate that this is stepping outside of the Windows Server 2008 / PowerShell "remoting" arena, but it does at least work.

You must log in to answer this question.