How to run a process as non-admin from an elevated PowerShell console?

前端 未结 4 1755
孤独总比滥情好
孤独总比滥情好 2021-02-05 13:51

Maybe there is a way to do it with Start-Process cmdlet that I cannot find? The other related Q/A\'s I found on StackOverflow such as this, this and this all give a solution to

4条回答
  •  不要未来只要你来
    2021-02-05 14:32

    You can specify the TrustLevel with runas.exe, effectively running "restricted"

    runas /trustlevel:0x20000 "powershell.exe -command 'whoami /groups |clip'"
    

    You should see in the output from whoami that the Administrators group in your token is marked as "Used for Deny only"


    enter image description here

提交回复
热议问题