• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Running a Powershell script under Local System rights?

P

Philip Jensen

#1
Hello everybody,
I am new to this newsgroup, therefore I'm not sure if a similar question
has been asked previously. If so please bare with me.

Anyway, I would like to have a Powershell Script to be executed under
Local System rights (NT AUTHORITY\SYSTEM) as many installed Windows
Services do by default (Log on as System). Is this possible to do? Maybe
by writing a Windows Service using C# which in turn executes Powershell
scripts?

Thanks in advance,
Philip
 
R

RichS

#2
It is possible to host PowerShell with C# applications. Theres an example
here

http://msdn2.microsoft.com/en-us/library/ms714630.aspx
--
Richard Siddaway

Please note that all scripts are supplied "as is" and with no warranty


"Philip Jensen" wrote:

> Hello everybody,
> I am new to this newsgroup, therefore I'm not sure if a similar question
> has been asked previously. If so please bare with me.
>
> Anyway, I would like to have a Powershell Script to be executed under
> Local System rights (NT AUTHORITY\SYSTEM) as many installed Windows
> Services do by default (Log on as System). Is this possible to do? Maybe
> by writing a Windows Service using C# which in turn executes Powershell
> scripts?
>
> Thanks in advance,
> Philip
>