WbemAuthenticationLevelEnum 列舉 (wbemdisp.h)

WbemAuthenticationLevelEnum 常數會定義安全性驗證層級。 這些常數會搭配 SWbemSecurity 和 WMI 的 Moniker 連線使用。

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" encoding="US-ASCII"?>
    <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>
    
    

    如需詳細資訊,請參閱 使用 WMI 腳本類型庫

Syntax

typedef enum WbemAuthenticationLevelEnum {
  wbemAuthenticationLevelDefault = 0,
  wbemAuthenticationLevelNone = 1,
  wbemAuthenticationLevelConnect = 2,
  wbemAuthenticationLevelCall = 3,
  wbemAuthenticationLevelPkt = 4,
  wbemAuthenticationLevelPktIntegrity = 5,
  wbemAuthenticationLevelPktPrivacy = 6
} ;

常數

 
wbemAuthenticationLevelDefault
值: 0
wbemAuthenticationLevelNone
值: 1
wbemAuthenticationLevelConnect
值: 2
wbemAuthenticationLevelCall
值: 3
wbemAuthenticationLevelPkt
值: 4
wbemAuthenticationLevelPktIntegrity
值: 5
wbemAuthenticationLevelPktPrivacy
值: 6

規格需求

需求
最低支援的用戶端 Windows Vista
最低支援的伺服器 Windows Server 2008
標頭 wbemdisp.h

另請參閱

建構Moniker字串

SWbemSecurity

編寫 API 常數的腳本

在 VBScript 中設定異步呼叫的安全性

使用 VBScript 設定預設進程安全性層級