Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.