How to check if the process is run as elevated rights

hello guys, I have no idea how to use the powershell command to get the process status if it is run in elevated rights. From the GUI of windows task management, we can check from it. Anyone can give me some help on it from powershell. thank you.

jason,
Welcome to the forum. :wave:t4:

I googled it for you and got the following 3 as the first hits:

How to Check If a PowerShell Script Is Run As Administrator? | Windows OS Hub.

:wink:

hi Olaf, thank you for your quick reply. But all these 3 links is to check if the powershell process itself is run as administrator. What I want to do is use the get-process to get all process and then filter out the process are not run as elevated rights.

Ah … my bad … I missunderstood that. :smirk:

I googled that for you as well:

:wink:

Please … for the future … This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

We actually expect you to make an own attempt at the first place to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

1 Like