/bundles/itninjaweb/img/Breadcrumb_cap_w.png
HI

In PowerShell for Windows 7, how can I do to run a ps1 script as SYSTEM user?

THANKS

BYE
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
As with any other scipting language there's nothing special about PowerShell that would allow it to run as the System user. If there was, there would be a teensy-weensy security hole, don't you think?
Answered 07/25/2010 by: VBScab
Red Belt

Please log in to comment
0
You need to run the powershell in a console started as the system account.

Launch cmd.exe with "Run as administrator"
In the launched cmd.exe execute "psexec.exe -s cmd.exe" (get it from sysinternals.com)
Now execute your powershell (or what ever command you like) which should be executed under the system account
Answered 07/25/2010 by: AngelD
Red Belt

Please log in to comment
0
Re-reading the thread and your reply, Kim, I just remembered the old trick of how to run stuff as System without third-party tools, namely to execute a command prompt using the Task Scheduler, AT.EXE, something like:

AT hh:mm /interactive CMD
Answered 07/25/2010 by: VBScab
Red Belt

Please log in to comment