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

WbemAuthenticationLevelEnum

Previous pageReturn to chapter overviewNext page

WbemAuthenticationLevelEnum常量定义安全认证级别。这些常量与SWbemSecurity一起使用,并与WMI的标记连接使用。

 

WMI脚本类型库wbemdisp.tlb定义了这些常量。Visual Basic应用程序可以访问此库。

 

脚本语言必须使用以下之一:

 

·简称。例如,对于WbemAuthenticationLevelPktPrivacy,请使用“PktPrivacy”。

 

strComputer = "RemoteComputer"

Set objWMIServices = GetObject("WINMGMTS:" _

  & "{authenticationLevel=pktPrivacy}!\\" _

  & strComputer & "\ROOT\CIMV2")

 

·脚本中的Windows脚本宿主(WSH)XML文件格式。例如,这意味着脚本可以直接使用WbemAuthenticationLevelPkt常量。

 

以下WSH脚本设置身份验证级别。要运行脚本,请将文本保存在扩展名为.wsf的文件中。

 

<?xml version="1.0"?>

<job>

<reference object="WbemScripting.SWbemLocator"/>

<script language="VBScript">

  set service = GetObject("winmgmts:")

  ' Following line uses a symbolic

  ' constant from the WMI type library

  service.Security_.authenticationLevel = _

      WbemAuthenticationLevelPktPrivacy

</script>

</job>

 

以下值可用于设置认证级别。

 

恒/值

描述

WbemAuthenticationLevelDefault

0

&H0

短名称:默认

 

WMI使用默认的Windows身份验证设置。

WbemAuthenticationLevelNone

1

&H1

短名称:无

 

不使用认证。

WbemAuthenticationLevelConnect

2

&H2

短名称:连接

 

仅当客户端与服务器建立关系时才验证客户端的凭据。

WbemAuthenticationLevelCall

3

&H3

短名称:电话

 

只有当服务器收到请求时,每次呼叫开始时才进行身份验证。

WbemAuthenticationLevelPkt

4

&H4

短名称:积分

 

验证收到的所有数据都是来自预期的客户端。

WbemAuthenticationLevelPktIntegrity

5

&H5

简称:PktIntegrity

 

验证并验证客户端和服务器之间传输的数据是否已被修改。

WbemAuthenticationLevelPktPrivacy

6

&H6

简称:PktPrivacy

 

验证所有先前的模拟级别,并加密每个远程过程调用的参数值。

 

要求

 

客户

需要Windows Vista,Windows XP,Windows 2000 Professional,Windows NT Workstation 4.0 SP4和更高版本,或Windows Me。

服务器

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

在Wbemdisp.inc中声明。

类型库

使用Wbemdisp.tlb。

DLL

需要Wbemdisp.dll。