Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a powershell script which executes after I logon to my account. This is done by a group policy logon script.

Because I am in the Administrator group this script is run with elevated rights which I don't want. I want it to run without the elevated rights and run it with the standard user access token. Is this possible and how can I achieve this?

UPDATE:

I need to have the script run with UAC virtualization.

Thanks in advance.

share|improve this question
    
Failing a more elegant solution, I suppose you could write a logon script that adds an entry into the RunOnce key so that Explorer will run the powershell. You'd probably need to make the logon script synchronous, to avoid a race condition. – Harry Johnston Dec 4 '11 at 0:44
    
@HarryJohnston Thanks for your alternative but I need to know if it's possible with a group policy. In the meantime I already use a other alternative: a scheduled task, but it also works from a batch file in my startup folder. – Martijn B Dec 5 '11 at 17:12

Use the -l option of psexec to launch your powershell script.

share|improve this answer
    
I tried your option but it doesn't give me the expected results. The -l option does run it without administrator rights but not with UAC virtualization. – Martijn B Dec 5 '11 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .