Session.Identify 方法

Session.Identify方法會查詢遠端電腦,以判斷它是否支援WS-Management通訊協定。 如需詳細資訊,請參閱 偵測遠端電腦是否支援WS-Management通訊協定

語法

Session.Identify( _
  [ ByVal flags ] _
)

參數

旗標 [in, 選擇性]

若要以已驗證模式傳送要求,請使用 來自 WSManSessionFlags 列舉的驗證常數。 若要以未經驗證模式傳送,請使用 WSManFlagUseNoAuthentication。 如需詳細資訊,請參閱 驗證常數

傳回值

XML 字串,指定WS-Management通訊協定版本、作業系統廠商,如果要求已通過驗證,則為作業系統版本。

備註

Session.Identify 是以定義為 wsmanIdentity 的 WS 管理通訊協定 作業為基礎。 這會在 SOAP 封包中指定,如下所示:

xmlns:wsmid="https://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity"

範例

下列 VBScript 範例會將未經驗證的識別要求傳送至相同網域中名為 Remote 的遠端電腦。

set WSMan = CreateObject("Wsman.Automation")
set Session = WSMan.CreateSession("Remote", _
  WSMan.SessionFlagUseNoAuthentication)
WScript.Echo Session.Identify

規格需求

需求
最低支援的用戶端
Windows Vista
最低支援的伺服器
Windows Server 2008
標頭
WSManDisp.h
Idl
WSManDisp.idl
程式庫
WSManDisp.tlb
DLL
WSMAuto.dll

另請參閱

工作階段

IWSManSession::Identify

WS-Management 通訊協定