0 out of 5 rated this helpful - Rate this topic

SWbemSecurity.ImpersonationLevel property

The ImpersonationLevel property is an integer that defines the COM impersonation level that is assigned to this object. This setting determines if processes owned by Windows Management Instrumentation (WMI) can detect or use your security credentials when making calls to other processes. For more information about impersonation levels, see Setting Client_Application_Process Security.

If you do not set the impersonation level specifically in either a moniker, or by setting the SWBemSecurity.ImpersonationLevel property on a securable object, WMI sets the default impersonation level to the value specified in the default impersonation level registry key. This registry value is set to wbemImpersonationLevelImpersonate for Windows 2000, Windows XP, and Windows Server 2003. Previous versions of WMI set the default impersonation level to WbemImpersonationLevelIdentify. If this setting is not sufficient, the provider does not service your request, and the call to the WMI API can fail with an error code of wbemErrAccessDenied (2147749891/0x80041003).

For an explanation of this syntax, see Document Conventions for the Scripting API.

This property is read/write.

Syntax

SWbemSecurity.ImpersonationLevel As Integer

Property value

Remarks

You can set the impersonation level of an SWbemServices, SWbemObject, SWbemObjectSet, SWbemObjectPath, and SwbemLocator object by setting the ImpersonationLevel property to the desired value. The following example shows you how to set the impersonation level for an SWbemObject object:

objinstance.Security_.ImpersonationLevel = _
    wbemImpersonationLevelImpersonate

You can also specify impersonation levels as part of a moniker. The following example sets the authentication level and the impersonation level, and retrieves an instance of Win32_Service.

Set objinst = GetObject("WinMgmts:{impersonationLevel=impersonate,"& _
                         "authenticationLevel=pktPrivacy}"& _
                         "!root/cimv2:Win32_service='ALERTER'")

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Type library

Wbemdisp.tlb

DLL

Wbemdisp.dll

See also

SWbemSecurity
Setting Client_Application_Process Security
WbemImpersonationLevelEnum

 

 

Send comments about this topic to Microsoft

Build date: 11/19/2012

Community Additions

ADD
© 2013 Microsoft. All rights reserved.