INFO: Default DCOM Impersonation Level Changed in Windows Management Instrumentation Version 1.5

Article translations Article translations
Article ID: 243488 - View products that this article applies to.
This article was previously published under Q243488
Expand all | Collapse all

SUMMARY

In Microsoft Windows Management Instrumentation version 1.5, the default DCOM impersonation level is RPC_C_IMP_LEVEL_IMPERSONATE. In earlier versions of WMI, the default level was RPC_C_IMP_LEVEL_IDENTIFY.

MORE INFORMATION

In WMI 1.1, you had to explicitly set the DCOM impersonation level to RPC_C_IMP_LEVEL_IMPERSONATE. For example, the following Microsoft Visual Basic code explicitly sets the impersonation level:
Set classObj = GetObject("WinMgmts:{impersonationLevel=impersonate}!//./root/cimv2:Win32_logicalDisk")
For Each obj In classObj.instances_
    ' Process this instance
Next
				
This step is no longer necessary. For example:
Set classObj = GetObject("WinMgmts://./root/cimv2:Win32_logicalDisk")
For Each obj In classObj.instances_
    ' Process this instance
Next
				
In WMI 1.1, the classObj.instances_ call would fail with error code 0x80041003 (WBEM_E_ACCESS_DENIED) because the provider needs to impersonate the client in order to access system information. Because WMI 1.5 impersonates the client by default, the code would succeed. However, you may still want to explicitly set the impersonation level in order to maintain compatibility with previous versions of WMI.

REFERENCES

See the WMI programming documentation in the Platform SDK for more details.

Properties

Article ID: 243488 - Last Review: March 2, 2007 - Revision: 3.2
APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows Management Instrumentation 1.5
Keywords: 
kbinfo kbwbem KB243488

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com