Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista Tutorial - elevate privilege

Reply
 
Old 08-04-2008   #1 (permalink)
Calin Iaru
Guest


 
 

elevate privilege

I use powershell for most operations and would like to know if there's a way
to execute a program with elevated privileges. For instance, is there a way
to launch Process Explorer under Vista with Elevated Privileges?

My System SpecsSystem Spec
Old 08-04-2008   #2 (permalink)
Jon
Guest


 
 

Re: elevate privilege

"Calin Iaru" <Calin Iaru@xxxxxx> wrote in message
news:6C3516F4-30B4-41B8-B4FA-A00D50A9674A@xxxxxx
Quote:

>I use powershell for most operations and would like to know if there's a
>way
> to execute a program with elevated privileges. For instance, is there a
> way
> to launch Process Explorer under Vista with Elevated Privileges?

Yep, you could use a 'runas' flag with "ShellExecute" eg ....

$Shell = New-Object -ComObject "Shell.Application"
$Shell.ShellExecute("notepad.exe",$null,$null,"runas")

--
Jon



My System SpecsSystem Spec
Old 08-04-2008   #3 (permalink)
Calin Iaru
Guest


 
 

Re: elevate privilege

And a shortcut that can do this? For instance, run-elevated
e:\bin\procexp.exe? I would like to add the command to a profile script and
sign it. Can you please indicate how to sign a script using the default
certificates or vendor supplied certificates?

"Jon" wrote:
Quote:

> "Calin Iaru" <Calin Iaru@xxxxxx> wrote in message
> news:6C3516F4-30B4-41B8-B4FA-A00D50A9674A@xxxxxx
Quote:

> >I use powershell for most operations and would like to know if there's a
> >way
> > to execute a program with elevated privileges. For instance, is there a
> > way
> > to launch Process Explorer under Vista with Elevated Privileges?
>
>
> Yep, you could use a 'runas' flag with "ShellExecute" eg ....
>
> $Shell = New-Object -ComObject "Shell.Application"
> $Shell.ShellExecute("notepad.exe",$null,$null,"runas")
>
> --
> Jon
>
>
>
>
My System SpecsSystem Spec
Old 08-04-2008   #4 (permalink)
Jon
Guest


 
 

Re: elevate privilege

"Calin Iaru" <CalinIaru@xxxxxx> wrote in message
news:FC2C8688-FA7E-4D09-B2D4-453C4F056415@xxxxxx
Quote:

> And a shortcut that can do this? For instance, run-elevated
> e:\bin\procexp.exe?

Not sure what you mean by a 'shortcut'. If you have set up a suitable
registry association with .ps1 files then you can click on one or a
shortcut to it eg containing these 2 lines

$Shell = New-Object -ComObject "Shell.Application"
$Shell.ShellExecute("e:\bin\procexp.exe",$null,$null,"runas")




I would like to add the command to a profile script and
Quote:

> sign it. Can you please indicate how to sign a script using the default
> certificates or vendor supplied certificates?

You use 'Set-AuthenticodeSignature' for this with a suitable certificate

help Set-AuthenticodeSignature
help about_signing

--
Jon




My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
User Account Control (UAC) - Elevate Privilege Level Tutorials
Elevate Privilege @ the CMD prompt Vista General
How to elevate integrity level of a process Vista security
Elevate without losing the working directory? Vista security
UAC can not elevate Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46