WMI with the ASPNET account?

T

Todd

When running the following WMI Query in C# code as administr­ator, the
NetConnectionId ("Local Area Connection", etc.) for the NICs­ are
returned by the following query:


SELECT NetConnectionId FROM Win32_NetworkAdapter

However when running with the ASPNET account in a web servic­e, empty
NetConnectionId fields are returned even though rows are ret­unred for
each NIC.


I updated the security for the CIMV2 namespace in the WMICon­trol
utility; but, this did not change the results.


We have a machine that we pre-configure with specific NetCon­nectionId
values and we need to be able to retrieve the correct NIC ma­nagement
objects based on the NetConnectionId.


Any ideas?
 
T

Todd

I was able to resolve with help from Microsoft who debugged the
problem. It was determined that the COM object used by the WMI
provider returns "Access Denied" internally even though an empty string
is returned in the query instead of an error. This is true for all
non-administrator accounts. The NetConnectionId was added in XP which
proably has something to do with this behavior.

The work around is to enumerate the registry from the Network Adapter
Class GUID for the Settings GUID that corresponds to the desired
NetConnectionId (Lan Name). With the Settings GUID, you can then run a
WMI query to get the NetworkAdapterConfiguration object that includes
properies for the IP settings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top