Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

How can I use CimCredential in Web Page to get Printer Status ?

$
0
0
I have successfully implemented code which uses ManagementObjectSearcher to query and return the status of printers on one of our servers.

Now what I would like to do is use this code from an ASP.net web page so that my user community can view the status of those same printers. The problem is that the account that the webserver executes as does not have the appropriate permissions to retrieve the data.

My research seems to point to a method to get the data where I would pass credentials while executing the query.

The building blocks are:

1) Dim Credentials As New CimCredential(PasswordAuthenticationMechanism.Default, domain, username, securepassword)
 
2) Session = CimSession.Create(computer, SessionOptions)
 
3) session.QueryInstances("@root\cimv2", "WQL", "SELECT * FROM Win32_Printer")


However, I can't seem to find the proper reference to the Microsoft.Management.Infrastructure.dll

My development environment is VS2015 / Win10 and I plan to deploy the web application to a 7.5 IIS server.

Can someone help me find the correct dll location ?
Am I approaching this problem correctly ?

Thanks.

Viewing all articles
Browse latest Browse all 3938

Trending Articles



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