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
PScredsobject with the local admin account - start-process throw a
PSSessionusing the-Verb runasflag modifying the serverBscript to "Self elevate", but it still fails fromA - 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.