Minimal permission required to run a Get-WmiObject command

Hello,

I would like to set a job to run below script by a service ID, to extract users information from remote servers, may I ask if someone knows the minimal permission required?
We don't want to grant the service ID admin permission on all the servers.

Thanks so much in advance for your help!

Get-WmiObject win32_process -computer RemoteServerName | where{$_.Processid -eq 'remote_process_id'} | Select-Object processid,name,@{n='Owner';e={$_.GetOwner().User}}
Vivian_ShiAsked:
Who is Participating?
 
footechConnect With a Mentor Commented:
The user either has to be an admin (because admins already have the necessary permission on the WMI namespace) on the machine being queried, or you have to modify the WMI namespace security to add the account you want to use, specify which permissions you want to give the account.
Here's a script someone put together to help with modifying the WMI namespace security.
https://gist.github.com/exchange12rocks/950aa29f66e6369d2c02fa8583bb3a75
Go to the URL referenced at the beginning of the code for more description on how it works.
0
 
Vivian_ShiAuthor Commented:
Thanks for your advise! May I ask which namespaces I need to grant permission to the users?  For the particular script.
Thanks a lot!
0
 
footechCommented:
The Win32_Process class is in the "root/cimv2" namespace.
1
 
footechCommented:
Information given on needed permissions, and how to change them if desired.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.