Start ELEVATED script from within script
Posted
by Ulrich
on Server Fault
See other posts from Server Fault
or by Ulrich
Published on 2010-04-15T22:11:16Z
Indexed on
2010/04/15
22:13 UTC
Read the original article
Hit count: 212
Hallo,
I'm playing around with Powershell (relative NewBie) and I'm looking for the easiest way to call a Powershell script with elevated rights from within another script.
I know of the runas verb for start-process which allows me to start a new script with a different account. My problem is, however, that under Vista (UAC active) every admin account has two access tokens, a normal privilege one and an elevated one.
If I use the runas method, the second scripts gets started under the right account but with the non-elevated access token. Is there an easy way to control this?
Thanks a lot for your help!
Ulrich
© Server Fault or respective owner