勇芳软件工作室.汉化:  Windows Management Instrumentation > Scripting API for WMI > Scripting API Objects > SWbemSecurity >

AuthenticationLevel Property

Previous pageReturn to chapter overviewNext page

描述

 

AuthenticationLevel属性是一个整数,用于定义分配给此对象的COM认证级别。此设置确定如何保护从WMI发送的信息。有关认证级别的更多信息,请参阅设置Client_Application_Process安全性.一般来说,在进行WMI API调用时不需要设置认证级别。如果不设置此属性,则使用系统的默认COM身份验证级别。

 

PowerBASIC 语法

 

PROPERTY GET AuthenticationLevel () AS LONG

PROPERTY SET AuthenticationLevel (BYVAL iAuthenticationLevel AS LONG)

 

参数(仅限集属性)

 

iAuthenticationLevel

 

LONG.验证级别。

 

返回值(仅获取资源)

 

LONG.验证级别。

 

备注

 

通过将AuthenticationLevel属性设置为所需的值,可以设置SWbemServicesSWbemObjectSWbemObjectSetSWbemObjectPathSwbemLocator对象的身份验证级别。

 

以下示例显示如何设置SwbemObject对象的身份验证级别。

 

objinstance.Security_.AuthenticationLevel = wbemAuthenticationLevelPkt

 

您还可以将身份验证级别指定为绰号的一部分。以下示例设置身份验证级别和模拟级别,并检索Win32_LogicalDisk的实例。

 

Set objinst = GetObject("WinMgmts:{impersonationLevel=impersonate,"& _

                      "authenticationLevel=pktPrivacy}" & _

                      "!root/cimv2:Win32_LogicalDisk='c:'")

 

要求

 

客户

需要Windows Vista,Windows XP,Windows 2000 Professional,Windows NT Workstation 4.0 SP4及更高版本,Windows Me,Windows 98或Windows 95 OSR2及更高版本。

服务器

需要Windows Server 2008,Windows Server 2003,Windows 2000 Server或Windows NT Server 4.0 SP4及更高版本。

类型库

使用Wbemdisp.tlb。

Wbemdisp.inc。

DLL

需要Wbemdisp.dll。