Quantcast
Channel: Configuration and Deployment
Viewing all articles
Browse latest Browse all 3561

Querying WMI from ASP.NET application

$
0
0

How do I configure IIS and\or the application pool to allow my ASP .NET application to query WMI?

After testing locally using IIS Express on my Windows 10 dev machine, I have deployed an ASP .NET application to IIS 8.5 on Server 2012 R2.  It is a custom web printing tool running in its own application pool.

I am using Win32_Printer to get details on the printers.  However it keeps crashing wmiprvse.exe.

In the WMI-Activity event log I get:

Id={...};ClientMachine= XXXXX;User= IIS APPPOOL\xxxxxx;ClientProcessId=2856;Component=Unknown;Operation=StartIWbemServices::ExecQuery- root\CIMV2 : SELECT * FROM Win32_Printer WHERE Local=true;ResultCode=0x800706BE;PossibleCause=Unknown

If I login to the server (with my admin account) and use powershell to call Get-WmiObject Win32_Printer I get valid data returned.  After that the ASP .NET application works (at least until server restarts).

Thanks,

Mark


Viewing all articles
Browse latest Browse all 3561


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>