Is it possible to query WMI as Local System?

4.8k Views Asked by At

Is it possible to query WMI as the Local System account? I tried to test this out by creating a Local System instance of Internet Explorer, and running WMI Tools from it. I got an error saying that:

The core WMI components build number could not be determined

This works fine when I run it from my normal user account. I'm new to WMI, so is there a fundamental reason why this would not be possible?

2

There are 2 best solutions below

0
On BEST ANSWER

creating a Local System instance of Internet Explorer

I think I am going to have nightmares for weeks.

Anyway, we have code that runs in a service under Local System that queries WMI and it works just fine.

0
On

WMI can be run from any system account, it's not account dependant. You can run WMI queries for other systems accounts from a DOS command prompt for example like the following DOS command (that queries current OS settings):

runas /user:"<account_name>" wmic os get /all /format:list

Note: replace <account_name> with the account you want to run command as.

Other tools like rcmd or psexec can run commands as well worth checking out.

Although WMIC can be executed from command line, utilising WMI does become more complex when utilising it in advanced programming languages.