Server : Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6 System : Windows NT USER-PC 6.1 build 7601 (Windows 7 Professional Edition Service Pack 1) AMD64 User : User ( 0) PHP Version : 7.4.6 Disable Function : NONE Directory : C:/Windows/SysWOW64/WindowsPowerShell/v1.0/zh-TW/ |
<?xml version="1.0" encoding="utf-8"?> <helpItems schema="maml"> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Connect-WSMan </command:name> <maml:description> <maml:para>連線到遠端電腦上的 WinRM 服務。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Connect</command:verb> <command:noun>WSMan</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Connect-WSMan Cmdlet 會連線到遠端電腦的 WinRM 服務,並建立與遠端電腦的固定連線。您可以在 WS-Management 提供者的內容中使用這個 Cmdlet,連線到遠端電腦的 WinRM 服務。不過,您也可以在變更為 WS-Management 提供者之前,使用這個 Cmdlet 連線到遠端電腦的 WinRM 服務。遠端電腦將會出現在 WS-Management 提供者的根目錄中。 如需如何中斷與遠端電腦 WinRM 服務之連線的詳細資訊,請參閱 Disconnect-WSMan。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Connect-WSMan</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-WSMan</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <Transport>://<Server>:<Port>/<ApplicationName>。 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN。此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>wsman</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> <dev:type> <maml:name>Authentication</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <Transport>://<Server>:<Port>/<ApplicationName>。 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN。此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> <dev:type> <maml:name>int</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> 您可以在遠端電腦執行管理命令或查詢管理資料,而不需要建立 WS-Management 工作階段。您可以使用 Invoke-WSManAction 和 Get-WSManInstance 的 ComputerName 參數達到上述目的。使用 ComputerName 參數時,Windows PowerShell 會建立用於該單一命令的暫時連線。在命令執行完成之後,這個連線便會關閉。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Connect-WSMan -computer server01 PS C:\Users\testuser> cd wsman: PS WSMan:\> PS WSMan:\> dir WSManConfig: Microsoft.WSMan.Management\WSMan::WSMan ComputerName Type ------------ ---- localhost Container server01 Container </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會建立與遠端 server01 電腦的連線。 Connect-WSMan Cmdlet 通常是在 WS-Management 提供者的內容中,用來連線到遠端電腦 (在這個範例中就是 server01 電腦)。不過,您可以在變更為 WS-Management 提供者之前,使用此 Cmdlet 建立與遠端電腦的連線。這些連線將會出現在 ComputerName 清單中。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 2 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> $cred = Get-Credential Administrator Connect-WSMan -computer server01 -credential $cred PS C:\Users\testuser> cd wsman: PS WSMan:\> PS WSMan:\> dir WSManConfig: Microsoft.WSMan.Management\WSMan::WSMan ComputerName Type ------------ ---- localhost Container server01 Container </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會使用管理員帳戶認證,建立與遠端系統 server01 的連線。 第一個命令會使用 Get-Credential Cmdlet 取得系統管理員認證,然後將其儲存在 $cred 變數中。Get-Credential Cmdlet 會提示使用者輸入密碼或者使用者名稱和密碼。提示使用者的方式是透過對話方塊 或命令列 (視系統登錄設定而定)。 第二個命令會使用 Credential 參數,將儲存在 $cred 中的認證傳遞到 Connect-WSMan。接著 Connect-WSMan 會使用系統管理員認證連線到遠端系統 server01。 Connect-WSMan Cmdlet 通常是在 WS-Management 提供者的內容中,用來連線到遠端電腦 (在這個範例中就是 server01)。不過,您可以在變更為 WS-Management 提供者之前,使用此 Cmdlet 建立與遠端電腦的連線,而這些連線將會出現在 ComputerName 清單中。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 3 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Connect-WSMan -computer server01 -port 80 PS C:\Users\testuser> cd wsman: PS WSMan:\> PS WSMan:\> dir WSManConfig: Microsoft.WSMan.Management\WSMan::WSMan ComputerName Type ------------ ---- localhost Container server01 Container </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會透過連接埠 80 建立與遠端 server01 電腦的連線。 Connect-WSMan Cmdlet 通常是在 WS-Management 提供者的內容中,用來連線到遠端電腦 (在這個範例中就是 server01 電腦)。不過,您可以在變更為 WS-Management 提供者之前,使用此 Cmdlet 建立與遠端電腦的連線。這些連線將會出現在 ComputerName 清單中。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 4 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> $a = New-WSManSessionOption -operationtimeout 30000 Connect-WSMan -computer server01 -sessionoption $a PS C:\Users\testuser> cd wsman: PS WSMan:\> PS WSMan:\> dir WSManConfig: Microsoft.WSMan.Management\WSMan::WSMan ComputerName Type ------------ ---- localhost Container server01 Container </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會使用 New-WSManSessionOption 命令中定義的連線選項,建立與遠端 server01 電腦的連線。 第一個命令會使用 New-WSManSessionOption Cmdlet 將一組連線設定選項儲存在 $a 變數中。在這個範例中,工作階段選項會將連線逾時設定為 30 秒 (30,000 毫秒)。 第二個命令會使用 SessionOption 參數,將儲存在 $a 變數中的認證傳遞到 Connect-WSMan。接著,Connect-WSMan 會使用指定的工作階段選項連線到遠端 server01 電腦。 Connect-WSMan Cmdlet 通常是在 WS-Management 提供者的內容中,用來連線到遠端電腦 (在這個範例中就是 server01 電腦)。不過,您可以在變更為 WS-Management 提供者之前,使用此 Cmdlet 建立與遠端電腦的連線。這些連線將會出現在 ComputerName 清單中。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141437</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Disable-WSManCredSSP </command:name> <maml:description> <maml:para>停用用戶端電腦上的認證安全性服務提供者 (CredSSP) 驗證。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Disable</command:verb> <command:noun>WSManCredSSP</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Disable-WSManCredSPP Cmdlet 會停用用戶端或伺服器電腦的 CredSSP 驗證。使用 CredSSP 驗證時,使用者的認證會傳送到遠端電腦進行驗證。這類驗證是專為從某個遠端工作階段建立另一遠端工作階段的命令而設計。例如,如果您要在遠端電腦執行背景工作,請使用這類驗證。 這個 Cmdlet 是用來在 Role 參數中指定 Client,藉以停用用戶端的 CredSSP。接著,這個 Cmdlet 會執行下列作業: - 停用用戶端的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Client\Auth\CredSSP 設為 false。 - 從用戶端的 Windows CredSSP 原則 AllowFreshCredentials 移除所有 WSMan/* 設定。 這個 Cmdlet 是用來在 Role 參數中指定 Server,藉以停用伺服器的 CredSSP。接著,這個 Cmdlet 會執行下列作業: - 停用伺服器的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Service\Auth\CredSSP 設為 false。 警告:CredSSP 驗證會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。 若要停用 CredSSP 驗證,請使用 Disable-WSManCredSSP Cmdlet。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Disable-WSManCredSSP</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>Role</maml:name> <maml:description> <maml:para>接受其中一個可能的值:Client 或 Server。這些值指出要以用戶端或伺服器身分來停用 CredSSP。 如果這個 Cmdlet 是用來在 Role 參數中指定 Client,藉以停用用戶端的 CredSSP,則會執行下列作業: - 停用用戶端的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Client\Auth\CredSSP 設為 false。 - 從用戶端的 Windows CredSSP 原則 AllowFreshCredentials 移除所有 WSMan/* 設定。 如果這個 Cmdlet 是用來在 Role 參數中指定 Server,藉以停用伺服器的 CredSSP,則會執行下列作業: - 停用伺服器的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Service\Auth\CredSSP 設為 false。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>Role</maml:name> <maml:description> <maml:para>接受其中一個可能的值:Client 或 Server。這些值指出要以用戶端或伺服器身分來停用 CredSSP。 如果這個 Cmdlet 是用來在 Role 參數中指定 Client,藉以停用用戶端的 CredSSP,則會執行下列作業: - 停用用戶端的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Client\Auth\CredSSP 設為 false。 - 從用戶端的 Windows CredSSP 原則 AllowFreshCredentials 移除所有 WSMan/* 設定。 如果這個 Cmdlet 是用來在 Role 參數中指定 Server,藉以停用伺服器的 CredSSP,則會執行下列作業: - 停用伺服器的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Service\Auth\CredSSP 設為 false。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> 若要啟用 CredSSP 驗證,請使用 Enable-WSManCredSSP Cmdlet。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Disable-WSManCredSSP -Role Client </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>此命令會停用用戶端的 CredSSP,以防止委派至伺服器。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 2 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Disable-WSManCredSSP -Role Server </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>此命令會停用伺服器的 CredSSP,以防止來自用戶端的委派。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141438</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Disconnect-WSMan </command:name> <maml:description> <maml:para>中斷用戶端與遠端電腦上 WinRM 服務的連線。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Disconnect</command:verb> <command:noun>WSMan</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Disconnect-WSMan Cmdlet 會中斷用戶端與遠端電腦上 WinRM 服務的連線。如果您將 WS-Management 工作階段儲存在變數中,則工作階段物件會保留在變數內,但是 WS-Management 工作階段的狀態則會是 "Closed"。您可以在 WS-Management 提供者的內容中使用這個 Cmdlet,中斷用戶端與遠端電腦上 WinRM 服務的連線。不過,您也可以在變更為 WS-Management 提供者之前,使用這個 Cmdlet 中斷與遠端電腦上 WinRM 服務的連線。 如需如何連線到遠端電腦上 WinRM 服務的詳細資訊,請參閱 Connect-WSMan。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Disconnect-WSMan</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定您想要中斷連線的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。 注意:您不能中斷與本機主機的連線 (本機電腦的預設連線)。不過,如果您已建立本機電腦的另一個連線 (例如,使用電腦名稱建立連線),則可使用 Disconnect-WSMan Cmdlet 來移除該連線。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定您想要中斷連線的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。 注意:您不能中斷與本機主機的連線 (本機電腦的預設連線)。不過,如果您已建立本機電腦的另一個連線 (例如,使用電腦名稱建立連線),則可使用 Disconnect-WSMan Cmdlet 來移除該連線。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Disconnect-WSMan -computer server01 C:\PS> cd WSMan: PS WSMan:\> PS WSMan:\> dir WSManConfig: Microsoft.WSMan.Management\WSMan::WSMan ComputerName Type ------------ ---- localhost Container </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會刪除與遠端 server01 電腦的連線。 這個 Cmdlet 通常是在 WS-Management 提供者的內容中,用來中斷與遠端電腦 (在這個範例中就是 server01 電腦) 的連線。不過,您也可以在變更為 WSMan 提供者之前,使用 Disconnect-WSMan Cmdlet 移除與遠端電腦的連線。這些連線將不會出現在 ComputerName 清單中。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141439</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Enable-WSManCredSSP </command:name> <maml:description> <maml:para>啟用用戶端電腦上的認證安全性服務提供者 (CredSSP) 驗證。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Enable</command:verb> <command:noun>WSManCredSSP</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Enable-WSManCredSPP Cmdlet 會啟用用戶端或伺服器電腦的 CredSSP 驗證。使用 CredSSP 驗證時,使用者的認證會傳送到遠端電腦進行驗證。這類驗證是專為從某個遠端工作階段建立另一遠端工作階段的命令而設計。例如,如果您要在遠端電腦執行背景工作,請使用這類驗證。 這個 Cmdlet 是用來在 Role 參數中指定 Client,藉以啟用用戶端的 CredSSP。接著,這個 Cmdlet 會執行下列作業: - 啟用用戶端的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Client\Auth\CredSSP 設為 true。 - 在用戶端將 Windows CredSSP 原則 AllowFreshCredentials 設為 WSMan/Delegate。 - 注意:在完成伺服器認證時,這些設定可讓用戶端將明確的認證委派至伺服器。 這個 Cmdlet 是用來在 Role 參數中指定 Server,藉以啟用伺服器的 CredSSP。接著,這個 Cmdlet 會執行下列作業: - 啟用伺服器的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Service\Auth\CredSSP 設為 true。 - 注意:此原則設定可以讓伺服器做為用戶端的委派使用。 警告:CredSSP 驗證會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。 若要停用 CredSSP 驗證,請使用 Disable-WSManCredSSP Cmdlet。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Enable-WSManCredSSP</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>Role</maml:name> <maml:description> <maml:para>接受其中一個可能的值:Client 或 Server。這些值指出要以用戶端或伺服器身分來啟用 CredSSP。 如果 Role 參數指定 Client,這個 Cmdlet 會執行下列作業: - 啟用用戶端的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Client\Auth\CredSSP 設為 true。 - 在用戶端將 Windows CredSSP 原則 AllowFreshCredentials 設為 WSMan/Delegate。 - 注意:在完成伺服器認證時,這些設定可讓用戶端將明確的認證委派至伺服器。 如果 Role 參數指定 Server,這個 Cmdlet 會執行下列作業: - 啟用伺服器的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Service\Auth\CredSSP 設為 true。 - 注意:此原則設定可以讓伺服器做為用戶端的委派使用。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2"> <maml:name>DelegateComputer</maml:name> <maml:description> <maml:para>允許將用戶端認證委派至此參數所指定的伺服器。此參數的值必須是完整網域名稱。 如果 Role 參數指定 Client,DelegateComputer 參數便為必要項。 如果 Role 參數指定 Server,則不允許使用 DelegateComputer 參數。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2"> <maml:name>DelegateComputer</maml:name> <maml:description> <maml:para>允許將用戶端認證委派至此參數所指定的伺服器。此參數的值必須是完整網域名稱。 如果 Role 參數指定 Client,DelegateComputer 參數便為必要項。 如果 Role 參數指定 Server,則不允許使用 DelegateComputer 參數。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>Role</maml:name> <maml:description> <maml:para>接受其中一個可能的值:Client 或 Server。這些值指出要以用戶端或伺服器身分來啟用 CredSSP。 如果 Role 參數指定 Client,這個 Cmdlet 會執行下列作業: - 啟用用戶端的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Client\Auth\CredSSP 設為 true。 - 在用戶端將 Windows CredSSP 原則 AllowFreshCredentials 設為 WSMan/Delegate。 - 注意:在完成伺服器認證時,這些設定可讓用戶端將明確的認證委派至伺服器。 如果 Role 參數指定 Server,這個 Cmdlet 會執行下列作業: - 啟用伺服器的 CredSSP。將 WS-Management 設定 <localhost|電腦名稱>\Service\Auth\CredSSP 設為 true。 - 注意:此原則設定可以讓伺服器做為用戶端的委派使用。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Xml.XmlElement</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 如果已成功啟用 CredSSP 驗證,這個 Cmdlet 會產生 XMLElement 物件。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> enable-wsmancredssp -role client -delegatecomputer server02.accounting.fabrikam.com cfg : http://schemas.microsoft.com/wbem/wsman/1/config/client/auth lang : en-US Basic : true Digest : true Kerberos : true Negotiate : true Certificate : true CredSSP : true </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令允許將用戶端認證委派至 server02 電腦。 </maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 2 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> enable-wsmancredssp -role client -delegatecomputer *.accounting.fabrikam.com cfg : http://schemas.microsoft.com/wbem/wsman/1/config/client/auth lang : en-US Basic : true Digest : true Kerberos : true Negotiate : true Certificate : true CredSSP : true </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令允許將用戶端認證委派至所有在 accounting.fabrikam.com 網域中的電腦。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 3 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> enable-wsmancredssp -role client -delegatecomputer server02.accounting.fabrikam.com, server03.accounting.fabrikam.com, server04.accounting.fabrikam.com cfg : http://schemas.microsoft.com/wbem/wsman/1/config/client/auth lang : en-US Basic : true Digest : true Kerberos : true Negotiate : true Certificate : true CredSSP : true </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令允許將用戶端認證委派至多台電腦。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 4 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> enable-wsmancredssp -role server </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>此命令可以讓電腦做為另一台電腦的委派使用。Enable-WSManCredSSP Cmdlet (如先前的範例所示) 只會啟用用戶端的 CredSSP 驗證,並指定可代表該用戶端的遠端電腦。在 WSMan 的 Service 節點中,CredSSP 項目必須設定為 true,遠端電腦才能當做用戶端的委派。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 5 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> connect-wsman server02 set-item wsman:\server02\service\auth\credSSP -value $true </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>此命令可以讓電腦做為另一台電腦的委派使用。先前範例中顯示的 Enable-WSManCredSSP 命令只會啟用用戶端電腦的 CredSSP 驗證,並指定可代表該用戶端電腦的遠端電腦。在 WSMan 提供者的 Service 目錄中,CredSSP 項目必須設定為 true,遠端電腦才能當做用戶端的委派。 在這個範例中,第一個命令會建立與遠端 server02 電腦的連線。 第二個命令會在遠端 server02 電腦上設定 credSSP 值,讓遠端電腦能夠當做委派使用。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141442</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Get-WSManCredSSP </command:name> <maml:description> <maml:para>取得用戶端的認證安全性服務提供者 (CredSSP) 相關設定。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Get</command:verb> <command:noun>WSManCredSSP</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Get-WSManCredSPP Cmdlet 會取得用戶端和伺服器的認證安全性服務提供者相關設定。其輸出將指出已啟用或停用認證安全性服務提供者 (CredSSP) 驗證,並顯示 CredSSP 之 AllowFreshCredentials 原則的設定資訊。當您使用 CredSSP 驗證時,使用者的認證會傳送到遠端電腦進行驗證。這類驗證是專為從某個遠端工作階段建立另一遠端工作階段的命令而設計。例如,如果您要在遠端電腦執行背景工作,請使用這類驗證。 這個 Cmdlet 會執行下列動作: - 取得用戶端的 WS-Management CredSSP 設定 (<localhost|電腦名稱>\Client\Auth\CredSSP)。 - 取得 Windows CredSSP 原則設定 AllowFreshCredentials。 - 取得伺服器的 WS-Management CredSSP 設定 (<localhost|電腦名稱>\Service\Auth\CredSSP)。 警告:CredSSP 驗證會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。 若要停用 CredSSP 驗證,請使用 Disable-WSManCredSSP Cmdlet。若要啟用 CredSSP 驗證,請使用 Enable-WSManCredSSP Cmdlet。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Get-WSManCredSSP</maml:name> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> get-wsmancredssp </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會顯示用戶端和伺服器的 CredSSP 設定資訊。 由輸出內容可得知此電腦是否已設定使用 CredSSP。 如果電腦已設定使用 CredSSP,則輸出如下: 「電腦設定為允許委派新認證給下列目標: wsman/server02.accounting.fabrikam.com」 如果電腦未設定使用 CredSSP,則輸出如下: 「尚未設定電腦以允許委派新認證。」</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141443</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Get-WSManInstance </command:name> <maml:description> <maml:para>顯示資源 URI 所指定之資源執行個體的管理資訊。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Get</command:verb> <command:noun>WSManInstance</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Get-WSManInstance Cmdlet 會擷取資源 URI 所指定之管理資源的執行個體。所擷取的資訊可能是複雜的 XML 資訊集 (物件) 或是簡單的值。此 Cmdlet 相當於標準的 WS-Management Get 命令。 此 Cmdlet 會使用 WS-Management 連線/傳輸層來擷取資訊。 </maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Get-WSManInstance</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Fragment</maml:name> <maml:description> <maml:para>指定要為指定之作業更新或擷取之執行個體內的區段。例如,若要取得多工緩衝處理器服務的狀態,請指定 "-Fragment Status"。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="1"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Dialect</maml:name> <maml:description> <maml:para>指定要在篩選器述詞中使用的方言。這可以是遠端服務所支援的任何方言。下列別名可用於方言 URI: - WQL:http://schemas.microsoft.com/wbem/wsman/1/WQL - Selector:http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter - Association:http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-WSManInstance</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>BasePropertiesOnly</maml:name> <maml:description> <maml:para>只列舉屬於 ResourceURI 參數所指定之基底類別的屬性。此參數不能與 Shallow 參數同時指定。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Enumerate</maml:name> <maml:description> <maml:para>傳回管理資源的所有執行個體。</maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>filter</maml:name> <maml:description> <maml:para>指定列舉的篩選運算式。如果您使用此參數,也必須指定 Dialect 參數。 此參數的有效值需視 Dialect 參數中指定的方言而定。舉例來說,若 Dialect 參數設為 WQL,則 Filter 參數必須包含字串,且該字串必須包含有效的 WQL 查詢,例如下列查詢: "Select * from Win32_Service where State != Running" 如果 Dialect 參數設為 Association,則 Filter 參數必須包含字串,且該字串必須包含有效的篩選器,例如下列篩選器: -filter:Object=EPR[;AssociationClassName=AssocClassName][;ResultClassName=ClassName][;Role=RefPropertyName][;ResultRole=RefPropertyName]} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>References</maml:name> <maml:description> <maml:para>表示應該擷取關聯 (Association) 執行個體,而不是關聯的 (Associated) 執行個體。只有當 Dialect 參數設為 "Association" 的值時,您才能使用這個參數。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ReturnType</maml:name> <maml:description> <maml:para>指定要傳回的資料型別。有效的值包括: Object (預設) EPR ObjectAndEPR 如果指定 Object 或未使用此參數,只會傳回物件。如果指定 EPR (端點參考),則只會傳回物件的端點參考。參考端點包含有關執行個體之資源 URI 和選取器的資訊。如果指定 ObjectAndEPR,則會傳回物件以及其關聯的端點參考。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Shallow</maml:name> <maml:description> <maml:para>只能傳回資源 URI 中指定之基底類別的執行個體。如果未指定此切換參數,則會傳回 URI 及其所有衍生類別中指定之基底類別的執行個體。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="1"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Dialect</maml:name> <maml:description> <maml:para>指定要在篩選器述詞中使用的方言。這可以是遠端服務所支援的任何方言。下列別名可用於方言 URI: - WQL:http://schemas.microsoft.com/wbem/wsman/1/WQL - Selector:http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter - Association:http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-WSManInstance</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Fragment</maml:name> <maml:description> <maml:para>指定要為指定之作業更新或擷取之執行個體內的區段。例如,若要取得多工緩衝處理器服務的狀態,請指定 "-Fragment Status"。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="1"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Dialect</maml:name> <maml:description> <maml:para>指定要在篩選器述詞中使用的方言。這可以是遠端服務所支援的任何方言。下列別名可用於方言 URI: - WQL:http://schemas.microsoft.com/wbem/wsman/1/WQL - Selector:http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter - Association:http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-WSManInstance</maml:name> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>BasePropertiesOnly</maml:name> <maml:description> <maml:para>只列舉屬於 ResourceURI 參數所指定之基底類別的屬性。此參數不能與 Shallow 參數同時指定。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Enumerate</maml:name> <maml:description> <maml:para>傳回管理資源的所有執行個體。</maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>filter</maml:name> <maml:description> <maml:para>指定列舉的篩選運算式。如果您使用此參數,也必須指定 Dialect 參數。 此參數的有效值需視 Dialect 參數中指定的方言而定。舉例來說,若 Dialect 參數設為 WQL,則 Filter 參數必須包含字串,且該字串必須包含有效的 WQL 查詢,例如下列查詢: "Select * from Win32_Service where State != Running" 如果 Dialect 參數設為 Association,則 Filter 參數必須包含字串,且該字串必須包含有效的篩選器,例如下列篩選器: -filter:Object=EPR[;AssociationClassName=AssocClassName][;ResultClassName=ClassName][;Role=RefPropertyName][;ResultRole=RefPropertyName]} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>References</maml:name> <maml:description> <maml:para>表示應該擷取關聯 (Association) 執行個體,而不是關聯的 (Associated) 執行個體。只有當 Dialect 參數設為 "Association" 的值時,您才能使用這個參數。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ReturnType</maml:name> <maml:description> <maml:para>指定要傳回的資料型別。有效的值包括: Object (預設) EPR ObjectAndEPR 如果指定 Object 或未使用此參數,只會傳回物件。如果指定 EPR (端點參考),則只會傳回物件的端點參考。參考端點包含有關執行個體之資源 URI 和選取器的資訊。如果指定 ObjectAndEPR,則會傳回物件以及其關聯的端點參考。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Shallow</maml:name> <maml:description> <maml:para>只能傳回資源 URI 中指定之基底類別的執行個體。如果未指定此切換參數,則會傳回 URI 及其所有衍生類別中指定之基底類別的執行個體。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="1"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Dialect</maml:name> <maml:description> <maml:para>指定要在篩選器述詞中使用的方言。這可以是遠端服務所支援的任何方言。下列別名可用於方言 URI: - WQL:http://schemas.microsoft.com/wbem/wsman/1/WQL - Selector:http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter - Association:http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>wsman</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> <dev:type> <maml:name>Authentication</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>BasePropertiesOnly</maml:name> <maml:description> <maml:para>只列舉屬於 ResourceURI 參數所指定之基底類別的屬性。此參數不能與 Shallow 參數同時指定。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Dialect</maml:name> <maml:description> <maml:para>指定要在篩選器述詞中使用的方言。這可以是遠端服務所支援的任何方言。下列別名可用於方言 URI: - WQL:http://schemas.microsoft.com/wbem/wsman/1/WQL - Selector:http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter - Association:http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>http://schemas.microsoft.com/wbem/wsman/1/WQL </dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Enumerate</maml:name> <maml:description> <maml:para>傳回管理資源的所有執行個體。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>filter</maml:name> <maml:description> <maml:para>指定列舉的篩選運算式。如果您使用此參數,也必須指定 Dialect 參數。 此參數的有效值需視 Dialect 參數中指定的方言而定。舉例來說,若 Dialect 參數設為 WQL,則 Filter 參數必須包含字串,且該字串必須包含有效的 WQL 查詢,例如下列查詢: "Select * from Win32_Service where State != Running" 如果 Dialect 參數設為 Association,則 Filter 參數必須包含字串,且該字串必須包含有效的篩選器,例如下列篩選器: -filter:Object=EPR[;AssociationClassName=AssocClassName][;ResultClassName=ClassName][;Role=RefPropertyName][;ResultRole=RefPropertyName]} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Fragment</maml:name> <maml:description> <maml:para>指定要為指定之作業更新或擷取之執行個體內的區段。例如,若要取得多工緩衝處理器服務的狀態,請指定 "-Fragment Status"。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> <dev:type> <maml:name>int</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>References</maml:name> <maml:description> <maml:para>表示應該擷取關聯 (Association) 執行個體,而不是關聯的 (Associated) 執行個體。只有當 Dialect 參數設為 "Association" 的值時,您才能使用這個參數。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="1"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ReturnType</maml:name> <maml:description> <maml:para>指定要傳回的資料型別。有效的值包括: Object (預設) EPR ObjectAndEPR 如果指定 Object 或未使用此參數,只會傳回物件。如果指定 EPR (端點參考),則只會傳回物件的端點參考。參考端點包含有關執行個體之資源 URI 和選取器的資訊。如果指定 ObjectAndEPR,則會傳回物件以及其關聯的端點參考。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>物件</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Shallow</maml:name> <maml:description> <maml:para>只能傳回資源 URI 中指定之基底類別的執行個體。如果未指定此切換參數,則會傳回 URI 及其所有衍生類別中指定之基底類別的執行個體。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個命令不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Xml.XmlElement</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> Get-WSManInstance Cmdlet 會產生 XMLElement 物件。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> get-wsmaninstance wmicimv2/win32_service -selectorset @{name="winrm"} -computername server01 xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service cim : http://schemas.dmtf.org/wbem/wscim/1/common type : p:Win32_Service_Type lang : en-US AcceptPause : false AcceptStop : true Caption : Windows Remote Management (WS-Management) CheckPoint : 0 CreationClassName : Win32_Service Description : Windows Remote Management (WinRM) service implements the WS-Management protocol for remote management. WS-Management is a standard web services protocol used for remote software and hardware management. The WinRM service listens on the network for WS-Management requests and processes them. The WinRM Service needs to be configured with a listener using the winrm.cmd command line tool or through Group Policy in order for it to listen over the network. The WinRM service provides access to WMI data and enables event collection. Event collection and subscription to events require that the service is running. WinRM messages use HTTP and HTTPS as transports. The WinRM service does not depend on IIS but is preconfigured to share a port with IIS on the same machine. The WinRM service reserves the /wsman URL prefix. To prevent conflicts with IIS, administrators should ensure that any websites hosted on IIS do not use the /wsman URL prefix. DesktopInteract : false DisplayName : Windows Remote Management (WS-Management) ErrorControl : Normal ExitCode : 0 InstallDate : InstallDate Name : winrm PathName : C:\Windows\System32\svchost.exe -k NetworkService ProcessId : 948 ServiceSpecificExitCode : 0 ServiceType : Share Process Started : true StartMode : Auto StartName : NT AUTHORITY\NetworkService State : Running Status : OK SystemCreationClassName : Win32_ComputerSystem SystemName : SERVER01 TagId : 0 WaitHint : 0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會傳回 Windows Management Instrumentation (WMI) 所公開有關遠端 server01 電腦上 WinRM 服務的所有資訊。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 2 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> get-wsmaninstance wmicimv2/win32_service -selectorset @{name="spooler"} -fragment status -computername server01 XmlFragment=OK </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令只會傳回遠端 server01 電腦上多工緩衝處理器服務的狀態。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 3 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> get-wsmaninstance -enumerate wmicimv2/win32_process OSName : Microsoft Windows Vista Ultimate |C:\Windows|\Device\Harddisk0\Partition3 OtherOperationCount : 11441 OtherTransferCount : 428570 PageFaults : 27346 PageFileUsage : 16428 ParentProcessId : 604 PeakPageFileUsage : 17588 PeakVirtualSize : 93876224 PeakWorkingSetSize : 12472 Priority : 8 PrivatePageCount : 16822272 ProcessId : 1160 QuotaNonPagedPoolUsage : 14 QuotaPagedPoolUsage : 126 QuotaPeakNonPagedPoolUsage : 16 QuotaPeakPagedPoolUsage : 159 ReadOperationCount : 29568 ReadTransferCount : 1660581404 SessionId : 0 Status : Status TerminationDate : TerminationDate ThreadCount : 23 UserModeTime : 763156892 VirtualSize : 80846848 WindowsVersion : 6.0.6001 WorkingSetSize : 11624448 WriteOperationCount : 1913 WriteTransferCount : 6825768 xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Process cim : http://schemas.dmtf.org/wbem/wscim/1/common type : p:Win32_Process_Type lang : en-US Caption : svchost.exe CommandLine : C:\Windows\System32\svchost.exe -k LocalSystemNetworkRestricted CreationClassName : Win32_Process CreationDate : CreationDate CSCreationClassName : Win32_ComputerSystem CSName : COMPUTER01 Description : svchost.exe ExecutablePath : C:\Windows\System32\svchost.exe ExecutionState : ExecutionState Handle : 1192 HandleCount : 832 ... </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會傳回本機電腦上 WMI Win32_Process 類別的所有執行個體。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 4 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> get-wsmaninstance -enumerate wmicimv2/win32_service -returntype epr xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service cim : http://schemas.dmtf.org/wbem/wscim/1/common type : p:Win32_Service_Type lang : en-US AcceptPause : false AcceptStop : false Caption : Visual Studio 2008 Remote Debugger CheckPoint : 0 CreationClassName : Win32_Service Description : Allows members of the Administrators group to remotely debug server applications using Visual Studio 2008. Use the Visual Studio 2008 Remote Debugging Configuration Wizard to enable this service. DesktopInteract : false DisplayName : Visual Studio 2008 Remote Debugger ErrorControl : Ignore ExitCode : 1077 InstallDate : InstallDate Name : msvsmon90 PathName : "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe" /s ervice msvsmon90 ProcessId : 0 ServiceSpecificExitCode : 0 ServiceType : Own Process Started : false StartMode : Disabled StartName : LocalSystem State : Stopped Status : OK SystemCreationClassName : Win32_ComputerSystem SystemName : COMPUTER01 TagId : 0 WaitHint : 0 ... </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會傳回與本機電腦上所有服務對應的端點參考。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 5 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Get-WSManInstance -Enumerate wmicimv2/* -filter "select * from win32_service where StartMode = 'Auto' and State = 'Stopped'" -computername server01 xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service cim : http://schemas.dmtf.org/wbem/wscim/1/common type : p:Win32_Service_Type lang : en-US AcceptPause : false AcceptStop : false Caption : Windows Media Center Service Launcher CheckPoint : 0 CreationClassName : Win32_Service Description : Starts Windows Media Center Scheduler and Windows Media Center Receiver services at startup if TV is enabled within Windows Media Center. DesktopInteract : false DisplayName : Windows Media Center Service Launcher ErrorControl : Ignore ExitCode : 0 InstallDate : InstallDate Name : ehstart PathName : C:\Windows\system32\svchost.exe -k LocalServiceNoNetwork ProcessId : 0 ServiceSpecificExitCode : 0 ServiceType : Share Process Started : false StartMode : Auto StartName : NT AUTHORITY\LocalService State : Stopped Status : OK SystemCreationClassName : Win32_ComputerSystem SystemName : Server01 TagId : 0 WaitHint : 0 ... </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會列出 Server01 遠端電腦上符合下列準則的所有服務: - 服務的啟動類型是「自動」。 - 服務已停止。 </maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 6 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> get-wsmaninstance winrm/config/listener -selectorset @{Address="*";Transport="http"} cfg : http://schemas.microsoft.com/wbem/wsman/1/config/listener xsi : http://www.w3.org/2001/XMLSchema-instance lang : en-US Address : * Transport : HTTP Port : 80 Hostname : Enabled : true URLPrefix : wsman CertificateThumbprint : ListeningOn : {100.0.0.1, 123.123.123.123, ::1, 2001:4898:0:fff:0:5efe:123.123.123.123...} </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會針對符合選取器集內之準則的接聽程式,列出本機電腦上的 WS-Management 接聽程式設定。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 7 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> get-wsmaninstance winrm/config/listener -selectorset @{Address="*";Transport="http"} -computername server01 cfg : http://schemas.microsoft.com/wbem/wsman/1/config/listener xsi : http://www.w3.org/2001/XMLSchema-instance lang : en-US Address : * Transport : HTTP Port : 80 Hostname : Enabled : true URLPrefix : wsman CertificateThumbprint : ListeningOn : {100.0.0.1, 123.123.123.124, ::1, 2001:4898:0:fff:0:5efe:123.123.123.124...} </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會針對符合選取器集內之準則的接聽程式,列出遠端 server01 電腦上的 WS-Management 接聽程式設定。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 8 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Get-WSManInstance -Enumerate -Dialect association -filter "{Object=win32_service?name=winrm}" -res wmicimv2/* xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_ComputerSystem cim : http://schemas.dmtf.org/wbem/wscim/1/common type : p:Win32_ComputerSystem_Type lang : en-US AdminPasswordStatus : 1 AutomaticManagedPagefile : true AutomaticResetBootOption : true AutomaticResetCapability : true BootOptionOnLimit : BootOptionOnLimit BootOptionOnWatchDog : BootOptionOnWatchDog BootROMSupported : true BootupState : Normal boot Caption : SERVER01 ChassisBootupState : 3 CreationClassName : Win32_ComputerSystem CurrentTimeZone : -480 DaylightInEffect : false Description : AT/AT COMPATIBLE DNSHostName : server01 Domain : site01.corp.fabrikam.com DomainRole : 1 EnableDaylightSavingsTime : true FrontPanelResetStatus : 2 InfraredSupported : false InstallDate : InstallDate KeyboardPasswordStatus : 2 LastLoadInfo : LastLoadInfo Manufacturer : Dell Inc. Model : OptiPlex 745 Name : SERVER01 NameFormat : NameFormat NetworkServerModeEnabled : true NumberOfLogicalProcessors : 2 NumberOfProcessors : 1 OEMStringArray : www.dell.com PartOfDomain : true PauseAfterReset : -1 PCSystemType : 5 PowerManagementSupported : PowerManagementSupported PowerOnPasswordStatus : 1 PowerState : 0 PowerSupplyState : 3 PrimaryOwnerContact : PrimaryOwnerContact PrimaryOwnerName : testuser01 ResetCapability : 1 ResetCount : -1 ResetLimit : -1 Roles : {LM_Workstation, LM_Server, SQLServer, NT} Status : OK SystemStartupDelay : SystemStartupDelay SystemStartupSetting : SystemStartupSetting SystemType : X86-based PC ThermalState : 3 TotalPhysicalMemory : 3217760256 UserName : FABRIKAM\testuser01 WakeUpType : 6 Workgroup : Workgroup xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service cim : http://schemas.dmtf.org/wbem/wscim/1/common type : p:Win32_Service_Type lang : en-US AcceptPause : false AcceptStop : false Caption : Remote Procedure Call (RPC) CheckPoint : 0 CreationClassName : Win32_Service Description : Serves as the endpoint mapper and COM Service Control Manager. If this service is stopped or disabled, programs using COM or Remote Procedure Call (RPC) services will not function properly. DesktopInteract : false DisplayName : Remote Procedure Call (RPC) ErrorControl : Normal ExitCode : 0 InstallDate : InstallDate Name : RpcSs PathName : C:\Windows\system32\svchost.exe -k rpcss ProcessId : 1100 ServiceSpecificExitCode : 0 ServiceType : Share Process Started : true StartMode : Auto StartName : NT AUTHORITY\NetworkService State : Running Status : OK SystemCreationClassName : Win32_ComputerSystem SystemName : SERVER01 TagId : 0 WaitHint : 0 xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_SystemDriver cim : http://schemas.dmtf.org/wbem/wscim/1/common type : p:Win32_SystemDriver_Type lang : en-US AcceptPause : false AcceptStop : true Caption : HTTP CreationClassName : Win32_SystemDriver Description : HTTP DesktopInteract : false DisplayName : HTTP ErrorControl : Normal ExitCode : 0 InstallDate : InstallDate Name : HTTP PathName : C:\Windows\system32\drivers\HTTP.sys ServiceSpecificExitCode : 0 ServiceType : Kernel Driver Started : true StartMode : Manual StartName : State : Running Status : OK SystemCreationClassName : Win32_ComputerSystem SystemName : SERVER01 TagId : 0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會取得與指定之執行個體 (winrm) 相關之關聯的 (Associated) 執行個體。 重要:您必須以引號括住篩選器,如範例所示。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 9 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Get-WSManInstance -Enumerate -Dialect association -References -filter "{Object=win32_service?name=winrm}" -res wmicimv2/* </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會取得與指定之執行個體 (winrm) 相關的關聯 (Association) 執行個體。因為 Dialect 參數設定為 "association",而且使用了 Reference 參數,所以這個命令會傳回關聯 (Association) 執行個體,而不是關聯的 (Associated) 執行個體。 重要:您必須以引號括住篩選器,如範例所示。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141444</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Invoke-WSManAction </command:name> <maml:description> <maml:para>叫用由資源 URI 和選取器所指定之物件上的動作。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Invoke</command:verb> <command:noun>WSManAction</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Invoke-WSManAction 會針對 RESOURCE_URI 所指定的物件執行動作,其中參數是由索引鍵值組所指定。 此 Cmdlet 會使用 WSMan 連線/傳輸層來執行動作。 </maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Invoke-WSManAction</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 WSMAN。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="1"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="2"> <maml:name>Action</maml:name> <maml:description> <maml:para>指出要針對由 ResourceURI 和選取器所指定之管理物件執行的方法。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>FilePath</maml:name> <maml:description> <maml:para>指定用來更新管理資源之檔案的路徑。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。例如,下列命令會使用 FilePath 參數: invoke-wsmanaction -action stopservice -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default 這個命令會使用檔案的輸入,對多工緩衝處理器服務呼叫 StopService 方法。Input.xml 檔案包含下列內容: <p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service"/></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">File</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ValueSet</maml:name> <maml:description> <maml:para>指定可協助修改管理資源的雜湊表。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。ValueSet 參數的值必須是雜湊表。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-WSManAction</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="1"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="2"> <maml:name>Action</maml:name> <maml:description> <maml:para>指出要針對由 ResourceURI 和選取器所指定之管理物件執行的方法。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>FilePath</maml:name> <maml:description> <maml:para>指定用來更新管理資源之檔案的路徑。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。例如,下列命令會使用 FilePath 參數: invoke-wsmanaction -action stopservice -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default 這個命令會使用檔案的輸入,對多工緩衝處理器服務呼叫 StopService 方法。Input.xml 檔案包含下列內容: <p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service"/></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">File</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ValueSet</maml:name> <maml:description> <maml:para>指定可協助修改管理資源的雜湊表。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。ValueSet 參數的值必須是雜湊表。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="2"> <maml:name>Action</maml:name> <maml:description> <maml:para>指出要針對由 ResourceURI 和選取器所指定之管理物件執行的方法。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 WSMAN。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>wsman</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>FilePath</maml:name> <maml:description> <maml:para>指定用來更新管理資源之檔案的路徑。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。例如,下列命令會使用 FilePath 參數: invoke-wsmanaction -action stopservice -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default 這個命令會使用檔案的輸入,對多工緩衝處理器服務呼叫 StopService 方法。Input.xml 檔案包含下列內容: <p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service"/></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">File</command:parameterValue> <dev:type> <maml:name>File</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> <dev:type> <maml:name>int</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="1"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ValueSet</maml:name> <maml:description> <maml:para>指定可協助修改管理資源的雜湊表。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。ValueSet 參數的值必須是雜湊表。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> invoke-wsmanaction -action startservice -resourceuri wmicimv2/win32_service -selectorset @{name="spooler"} -authentication default xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service cim : http://schemas.dmtf.org/wbem/wscim/1/common lang : en-US ReturnValue : 0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會呼叫與多工緩衝處理器服務對應之 Win32_Service WMI 類別執行個體的 StartService 方法。 傳回值表示動作是否已成功執行。在這個範例中,傳回值 0 表示成功。傳回值 5 則表示服務已經啟動。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 2 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> invoke-wsmanaction -action stopservice -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:input.xml -authentication default xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service cim : http://schemas.dmtf.org/wbem/wscim/1/common lang : en-US ReturnValue : 0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會使用檔案的輸入,對多工緩衝處理器服務呼叫 StopService 方法。Input.xml 檔案包含下列內容: <p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service"/> 傳回值表示動作是否已成功執行。在這個範例中,傳回值 0 表示成功。傳回值 5 則表示服務已經啟動。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 3 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> invoke-wsmanaction -action create -resourceuri wmicimv2/win32_process -valueset @{commandline="notepad.exe";currentdirectory="C:\"} xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Process cim : http://schemas.dmtf.org/wbem/wscim/1/common lang : en-US ProcessId : 6356 ReturnValue : 0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會呼叫 Win32_Process 類別的 Create 方法,並將兩個參數值 Notepad.exe 和 "C:\" 傳遞給它。執行命令之後,便會建立新的處理序以執行 [筆記本],並將新處理序目前的目錄設定為 "C:\"。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 4 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> invoke-wsmanaction -action startservice -resourceuri wmicimv2/win32_service -selectorset @{name="spooler"} -computername server01 -authentication default xsi : http://www.w3.org/2001/XMLSchema-instance p : http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service cim : http://schemas.dmtf.org/wbem/wscim/1/common lang : en-US ReturnValue : 0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會呼叫與多工緩衝處理器服務對應之 Win32_Service WMI 類別執行個體的 StartService 方法。因為指定了 ComputerName 參數,所以這個命令會針對遠端 server01 電腦執行。 傳回值表示動作是否已成功執行。在這個範例中,傳回值 0 表示成功。傳回值 5 則表示服務已經啟動。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141446</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WmiMethod</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> New-WSManInstance </command:name> <maml:description> <maml:para>建立管理資源的新執行個體。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>WSManInstance</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>New-WSManInstance Cmdlet 會建立管理資源的新執行個體。它會使用資源 URI 以及值組或輸入檔案來建立管理資源的新執行個體。 這個 Cmdlet 會使用 WinRM 連線/傳輸層來建立管理資源執行個體。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>New-WSManInstance</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="2"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>AuthenticationMechanism</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ValueSet</maml:name> <maml:description> <maml:para>指定可協助修改管理資源的雜湊表。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。ValueSet 參數的值必須是雜湊表。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>New-WSManInstance</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="2"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>AuthenticationMechanism</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ValueSet</maml:name> <maml:description> <maml:para>指定可協助修改管理資源的雜湊表。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。ValueSet 參數的值必須是雜湊表。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>wsman</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>AuthenticationMechanism</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>File</maml:name> <maml:description> <maml:para>指定用來建立管理資源之檔案的路徑。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。例如,下列命令會使用 File 參數: invoke-wsmanaction -action stopservice -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -File c:\input.xml -authentication default 這個命令會使用檔案的輸入,對多工緩衝處理器服務呼叫 StopService 方法 [描述元]。Input.xml 檔案包含下列內容: <p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service"/></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">File</command:parameterValue> <dev:type> <maml:name>File</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> <dev:type> <maml:name>int</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="2"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ValueSet</maml:name> <maml:description> <maml:para>指定可協助修改管理資源的雜湊表。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。ValueSet 參數的值必須是雜湊表。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> Set-WmiInstance Cmdlet 與 Windows Management Instrumentation (WMI) Cmdlet 類似。Set-WmiInstance 會使用 DCOM 連線/傳輸層來建立或更新 WMI 執行個體。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> New-WSManInstance winrm/config/Listener -SelectorSet @{Transport=HTTPS} -ValueSet @{Hostname="HOST";CertificateThumbprint="XXXXXXXXXX"} </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會針對所有 IP 位址建立 WS-Management HTTPS 接聽程式的執行個體。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141448</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> New-WSManSessionOption </command:name> <maml:description> <maml:para>建立 WS-Management 工作階段選項雜湊表,以做為下列 WS-Management Cmdlet 的輸入參數: Get-WSManInstance Set-WSManInstance Invoke-WSManAction Connect-WSMan </maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>WSManSessionOption</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>建立 WSMan 工作階段選項雜湊表,可以傳入下列 WSMan Cmdlet: Get-WSManInstance Set-WSManInstance Invoke-WSManAction Connect-WSMan</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>New-WSManSessionOption</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>NoCompression</maml:name> <maml:description> <maml:para>關閉工作階段中的封包壓縮功能。壓縮功能預設為啟用,而且會壓縮在用戶端和伺服器之間傳送的封包。雖然壓縮功能會使用更多處理器循環,不過能加快傳輸速度。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>NoProxy</maml:name> <maml:description> <maml:para>不使用 Proxy 伺服器。在本機解析所有的主機名稱。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ProxyAuthentication</maml:name> <maml:description> <maml:para>指定要於 Proxy 使用的驗證方法。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Negotiate (預設):Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置,範例包括 Kerberos 通訊協定和 NTLM。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ProxyPassword</maml:name> <maml:description> <maml:para>指定要用於 Proxy 驗證的密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ProxyUserName</maml:name> <maml:description> <maml:para>指定要用於 Proxy 驗證的使用者名稱。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SkipCACheck</maml:name> <maml:description> <maml:para>指定透過 HTTPS 進行連線時,用戶端並不會驗證由受信任之憑證授權單位 (CA) 所簽署的伺服器憑證。請只有在遠端電腦透過其他方式獲得信任 (例如,如果遠端電腦位於實體安全且封閉的網路,或是遠端電腦在 WS-Management 設定中是列為信任的主機) 時,才使用此選項。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SkipCNCheck</maml:name> <maml:description> <maml:para>指定伺服器的憑證一般名稱 (CN) 不需要符合伺服器的主機名稱。這只適用於使用 HTTPS 執行的遠端操作。此選項只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SkipRevocation</maml:name> <maml:description> <maml:para>不要驗證伺服器憑證的撤銷狀態。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SPNPort</maml:name> <maml:description> <maml:para>指定要附加到遠端伺服器之服務主要名稱 <SPN> 連線的連接埠號碼。當驗證機制是 Kerberos 或 Negotiate 時,便會使用 SPN。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Timeout</maml:name> <maml:description> <maml:para>定義 WS-Management 作業的逾時 (毫秒)。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UnEncrypted</maml:name> <maml:description> <maml:para>在透過 HTTP 進行遠端操作時不要使用加密。 注意:預設不允許未加密的流量,因此必須在本機設定中啟用此功能。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseIEProxyconfig</maml:name> <maml:description> <maml:para>針對目前的使用者使用 Internet Explorer Proxy 設定。這是預設設定。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseProxyAutoDetection</maml:name> <maml:description> <maml:para>強制自動偵測 Proxy。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseWinHTTPProxyConfig</maml:name> <maml:description> <maml:para>使用為 WinHTTP 所設的 Proxy 設定。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UTF16</maml:name> <maml:description> <maml:para>以 UTF16 而非 UTF8 格式將要求編碼。預設為 UTF8 編碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>NoCompression</maml:name> <maml:description> <maml:para>關閉工作階段中的封包壓縮功能。壓縮功能預設為啟用,而且會壓縮在用戶端和伺服器之間傳送的封包。雖然壓縮功能會使用更多處理器循環,不過能加快傳輸速度。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>NoProxy</maml:name> <maml:description> <maml:para>不使用 Proxy 伺服器。在本機解析所有的主機名稱。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ProxyAuthentication</maml:name> <maml:description> <maml:para>指定要於 Proxy 使用的驗證方法。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Negotiate (預設):Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置,範例包括 Kerberos 通訊協定和 NTLM。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Negotiate</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ProxyPassword</maml:name> <maml:description> <maml:para>指定要用於 Proxy 驗證的密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ProxyUserName</maml:name> <maml:description> <maml:para>指定要用於 Proxy 驗證的使用者名稱。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SkipCACheck</maml:name> <maml:description> <maml:para>指定透過 HTTPS 進行連線時,用戶端並不會驗證由受信任之憑證授權單位 (CA) 所簽署的伺服器憑證。請只有在遠端電腦透過其他方式獲得信任 (例如,如果遠端電腦位於實體安全且封閉的網路,或是遠端電腦在 WS-Management 設定中是列為信任的主機) 時,才使用此選項。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SkipCNCheck</maml:name> <maml:description> <maml:para>指定伺服器的憑證一般名稱 (CN) 不需要符合伺服器的主機名稱。這只適用於使用 HTTPS 執行的遠端操作。此選項只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SkipRevocation</maml:name> <maml:description> <maml:para>不要驗證伺服器憑證的撤銷狀態。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SPNPort</maml:name> <maml:description> <maml:para>指定要附加到遠端伺服器之服務主要名稱 <SPN> 連線的連接埠號碼。當驗證機制是 Kerberos 或 Negotiate 時,便會使用 SPN。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> <dev:type> <maml:name>int</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Timeout</maml:name> <maml:description> <maml:para>定義 WS-Management 作業的逾時 (毫秒)。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> <dev:type> <maml:name>int</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UnEncrypted</maml:name> <maml:description> <maml:para>在透過 HTTP 進行遠端操作時不要使用加密。 注意:預設不允許未加密的流量,因此必須在本機設定中啟用此功能。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseIEProxyconfig</maml:name> <maml:description> <maml:para>針對目前的使用者使用 Internet Explorer Proxy 設定。這是預設設定。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseProxyAutoDetection</maml:name> <maml:description> <maml:para>強制自動偵測 Proxy。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseWinHTTPProxyConfig</maml:name> <maml:description> <maml:para>使用為 WinHTTP 所設的 Proxy 設定。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UTF16</maml:name> <maml:description> <maml:para>以 UTF16 而非 UTF8 格式將要求編碼。預設為 UTF8 編碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">switch</command:parameterValue> <dev:type> <maml:name>switch</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name></maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>SessionOption</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141449</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Remove-WSManInstance </command:name> <maml:description> <maml:para>刪除管理資源的執行個體。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Remove</command:verb> <command:noun>WSManInstance</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Remove-WSManInstance 會刪除 ResourceURI 和 SelectorSet 參數中指定之管理資源的執行個體。 這個 Cmdlet 會使用 WinRM 連線/傳輸層來刪除管理資源執行個體。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Remove-WSManInstance</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="2"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>AuthenticationMechanism</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-WSManInstance</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="2"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>AuthenticationMechanism</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>wsman</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>AuthenticationMechanism</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3} </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> <dev:type> <maml:name>int</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="2"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。 下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> Remove-WmiObject Cmdlet 與 Windows Management Instrumentation (WMI) Cmdlet 類似。Remove-WmiObject 會使用 DCOM 連線/傳輸層來建立或更新 WMI 執行個體。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Remove-WSManInstance winrm/config/Listener -SelectorSet Address=test.fabrikam.com;Transport=http </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>刪除電腦上的 WS-Management HTTP 接聽程式。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141453</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WmiObject</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Set-WSManInstance </command:name> <maml:description> <maml:para>修改與資源有關的管理資訊。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Set</command:verb> <command:noun>WSManInstance</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Set-WSManInstance Cmdlet 會修改與資源有關的管理資訊。 這個 Cmdlet 會使用 WinRM 連線/傳輸層來修改資訊。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Set-WSManInstance</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Fragment</maml:name> <maml:description> <maml:para>指定要為指定之作業更新或擷取之執行個體內的區段。例如,若要取得多工緩衝處理器服務的狀態,請指定 "-Fragment Status"。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="2"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Dialect</maml:name> <maml:description> <maml:para>指定要在篩選器述詞中使用的方言。這可以是遠端服務所支援的任何方言。下列別名可用於方言 URI: - WQL:http://schemas.microsoft.com/wbem/wsman/1/WQL - Selector:http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter - Association:http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named"> <maml:name>FilePath</maml:name> <maml:description> <maml:para>指定用來更新管理資源之檔案的路徑。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。例如,下列命令會使用 FilePath 參數: invoke-wsmanaction -action stopservice -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default 這個命令會使用檔案的輸入,對多工緩衝處理器服務呼叫 StopService 方法。Input.xml 檔案包含下列內容: <p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service"/></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">File</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named"> <maml:name>ValueSet</maml:name> <maml:description> <maml:para>指定可協助修改管理資源的雜湊表。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。ValueSet 參數的值必須是雜湊表。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Set-WSManInstance</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Fragment</maml:name> <maml:description> <maml:para>指定要為指定之作業更新或擷取之執行個體內的區段。例如,若要取得多工緩衝處理器服務的狀態,請指定 "-Fragment Status"。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="2"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Dialect</maml:name> <maml:description> <maml:para>指定要在篩選器述詞中使用的方言。這可以是遠端服務所支援的任何方言。下列別名可用於方言 URI: - WQL:http://schemas.microsoft.com/wbem/wsman/1/WQL - Selector:http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter - Association:http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named"> <maml:name>FilePath</maml:name> <maml:description> <maml:para>指定用來更新管理資源之檔案的路徑。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。例如,下列命令會使用 FilePath 參數: invoke-wsmanaction -action stopservice -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default 這個命令會使用檔案的輸入,對多工緩衝處理器服務呼叫 StopService 方法。Input.xml 檔案包含下列內容: <p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service"/></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">File</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named"> <maml:name>ValueSet</maml:name> <maml:description> <maml:para>指定可協助修改管理資源的雜湊表。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。ValueSet 參數的值必須是雜湊表。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ApplicationName</maml:name> <maml:description> <maml:para>指定連線中的應用程式名稱。ApplicationName 參數的預設值為 "WSMAN"。遠端端點的完整識別元的格式如下: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 例如: http://server01:8080/WSMAN 為工作階段提供服務的 Internet Information Services (IIS) 會將包含此端點的要求轉送到指定的應用程式。此 "WSMAN" 的預設設定適合大部分使用情況。此參數是為了多台電腦遠端連線到一台執行 Windows PowerShell 的電腦時使用而設計。在此情況下,IIS 會裝載 Web Services for Management (WS-Management) 以提升效率。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>wsman</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。這是預設值。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。您可以經由管道將此參數的值輸出至 Cmdlet。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ConnectionURI</maml:name> <maml:description> <maml:para>指定連線端點。此字串的格式為: <傳輸>://<伺服器>:<連接埠>/<ApplicationName> 下列字串是此參數的正確格式值: http://Server01:8080/WSMAN 此 URI 必須是完整的 URI。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Dialect</maml:name> <maml:description> <maml:para>指定要在篩選器述詞中使用的方言。這可以是遠端服務所支援的任何方言。下列別名可用於方言 URI: - WQL:http://schemas.microsoft.com/wbem/wsman/1/WQL - Selector:http://schemas.microsoft.com/wbem/wsman/1/wsman/SelectorFilter - Association:http://schemas.dmtf.org/wbem/wsman/1/cimbinding/associationFilter</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>http://schemas.microsoft.com/wbem/wsman/1/WQL </dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named"> <maml:name>FilePath</maml:name> <maml:description> <maml:para>指定用來更新管理資源之檔案的路徑。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。例如,下列命令會使用 FilePath 參數: invoke-wsmanaction -action stopservice -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name="spooler"} -FilePath:c:\input.xml -authentication default 這個命令會使用檔案的輸入,對多工緩衝處理器服務呼叫 StopService 方法。Input.xml 檔案包含下列內容: <p:StopService_INPUT xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service"/></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">File</command:parameterValue> <dev:type> <maml:name>File</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Fragment</maml:name> <maml:description> <maml:para>指定要為指定之作業更新或擷取之執行個體內的區段。例如,若要取得多工緩衝處理器服務的狀態,請指定 "-Fragment Status"。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>OptionSet</maml:name> <maml:description> <maml:para>將一組切換參數傳遞到服務,以修改或精簡要求的性質。這些切換參數與命令列殼層中使用的切換參數相似,因為它們都是服務專有的參數。您可以指定任何數量的選項。 下列範例會示範將值 1、2、3 傳遞給參數 a、b、c 的語法: -OptionSet @{a=1;b=2;c=3}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Port</maml:name> <maml:description> <maml:para>指定用戶端與 WinRM 服務連線時所要使用的連接埠。傳輸協定為 HTTP 時的預設連接埠是 80。傳輸協定為 HTTPS 時的預設連接埠是 443。當您使用 HTTPS 做為傳輸協定時,ComputerName 參數的值必須與伺服器的憑證一般名稱 (CN) 相符。然而,若將 SkipCNCheck 參數指定為 SessionOption 參數的一部分,則伺服器的憑證一般名稱不必與伺服器的主機名稱相符。SkipCNCheck 參數只能用於受信任的電腦。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">int</command:parameterValue> <dev:type> <maml:name>int</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para>包含資源類別或執行個體的統一資源識別項 (URI)。URI 是用來識別電腦上特定類型的資源,如磁碟或處理序。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="2"> <maml:name>SelectorSet</maml:name> <maml:description> <maml:para>指定一組用來選取特定管理資源執行個體的值組。有一個以上的資源執行個體時,就必須使用 SelectorSet 參數。SelectorSet 參數的值必須是雜湊表。下列範例示範如何輸入此參數的值: -SelectorSet @{Name="WinRM";ID="yyy"}</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>SessionOption</maml:name> <maml:description> <maml:para>定義一組用於 WS-Management 工作階段的擴充選項。請輸入使用 New-WSManSessionOption Cmdlet 所建立的 SessionOption 物件。如需可用選項的詳細資訊,請參閱 New-WSManSessionOption。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定必須使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定使用 HTTPS 提供多一層防護,而非使用 HTTP。如果連線所用的連接埠無法供 SSL 使用,但卻指定此參數,則命令會失敗。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="named"> <maml:name>ValueSet</maml:name> <maml:description> <maml:para>指定可協助修改管理資源的雜湊表。您可以使用 ResourceURI 參數和 SelectorSet 參數來指定管理資源。ValueSet 參數的值必須是雜湊表。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">hashtable</command:parameterValue> <dev:type> <maml:name>hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> set-wsmaninstance -resourceuri winrm/config/listener -selectorset @{address="*";transport="https"} -valueset @{Enabled="false"} cfg : http://schemas.microsoft.com/wbem/wsman/1/config/listener xsi : http://www.w3.org/2001/XMLSchema-instance lang : en-US Address : * Transport : HTTPS Port : 443 Hostname : Enabled : false URLPrefix : wsman CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.171, ::1, 2001:4898:0:fff:0:5efe:172.30.168.171...} </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會停用本機電腦上的 HTTPS 接聽程式。 重要:比對指定的屬性時,ValueSet 參數的值必須區分大小寫。 例如,使用上述命令時: 此設定會失敗: -ValueSet @{enabled="False"} 此設定會成功: -ValueSet @{Enabled="False"} </maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 2 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> set-wsmaninstance -resourceuri winrm/config -ValueSet @{MaxEnvelopeSizekb = "200"} cfg : http://schemas.microsoft.com/wbem/wsman/1/config lang : en-US MaxEnvelopeSizekb : 200 MaxTimeoutms : 60000 MaxBatchItems : 32000 MaxProviderRequests : 4294967295 Client : Client Service : Service Winrs : Winrs </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會將本機電腦上的 MaxEnvelopeSizekb 值設定為 200。 重要:比對指定的屬性時,ValueSet 參數的值必須區分大小寫。 例如,使用上述命令時: 此設定會失敗: -ValueSet @{MaxEnvelopeSizeKB ="200"} 此設定會成功: -ValueSet @{MaxEnvelopeSizekb ="200"}</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 3 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> set-wsmaninstance -resourceuri winrm/config/listener -computername SERVER02 -selectorset @{address="*";transport="https"} -valueset @{Enabled="false"} cfg : http://schemas.microsoft.com/wbem/wsman/1/config/listener xsi : http://www.w3.org/2001/XMLSchema-instance lang : en-US Address : * Transport : HTTPS Port : 443 Hostname : Enabled : false URLPrefix : wsman CertificateThumbprint : ListeningOn : {127.0.0.1, 172.30.168.172, ::1, 2001:4898:0:fff:0:5efe:172.30.168.172...} </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會停用遠端電腦 SERVER02 上的 HTTPS 接聽程式。 重要:比對指定的屬性時,ValueSet 參數的值必須區分大小寫。 例如,使用上述命令時: 此設定會失敗: -ValueSet @{enabled="False"} 此設定會成功: -ValueSet @{Enabled="False"}</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141458</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Set-WSManQuickConfig </command:name> <maml:description> <maml:para>設定本機電腦進行遠端管理。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Set</command:verb> <command:noun>WSManQuickConfig</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Set-WSManQuickConfig Cmdlet 會將電腦設定成接收使用 Web Services for Management (WS-Management) 技術所傳送的 Windows PowerShell 遠端命令。 這個 Cmdlet 會執行下列作業: 1. 檢查 WinRM 服務是否正在執行。如果 WinRM 服務沒有執行,服務將會啟動。 2. 將 WinRM 服務啟動類型設定為自動。 3. 建立接聽程式以接受任何 IP 位址的要求。根據預設,傳輸協定為 HTTP。 4. 為 WinRM 流量啟用防火牆例外。 若要在 Windows Vista、Windows Server 2008 和更新版的 Windows 中執行這個 Cmdlet,您必須使用 [以系統管理員身分執行] 選項啟動 Windows PowerShell。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Set-WSManQuickConfig</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定應該使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 因為 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定應該使用 HTTPS 提供多一層防護,而非使用 HTTP。如果指定此參數,但是在連線用的連接埠上無法使用 SSL,則命令會失敗。</maml:para> </maml:description> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>UseSSL</maml:name> <maml:description> <maml:para>指定應該使用安全通訊端層 (SSL) 通訊協定來建立與遠端電腦的連線。預設不會使用 SSL。 因為 WS-Management 會將所有透過網路傳輸的 Windows PowerShell 內容加密。UseSSL 參數可以讓您指定應該使用 HTTPS 提供多一層防護,而非使用 HTTP。如果指定此參數,但是在連線用的連接埠上無法使用 SSL,則命令會失敗。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Set-WSManQuickConfig </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會設定必要的組態,以啟用本機電腦的遠端管理功能。根據預設,這個命令會針對 HTTP 建立 WS-Management 接聽程式。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 2 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> Set-WSManQuickConfig -UseSSL </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會設定必要的組態,以啟用本機電腦的遠端管理功能。UseSSL 參數會讓這個命令針對 HTTPS 建立 WS-Management 接聽程式。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkID=141463</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSRemoting</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> Test-WSMan </command:name> <maml:description> <maml:para>測試 WinRM 服務是否正在本機或遠端電腦上執行。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>Test</command:verb> <command:noun>WSMan</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para>Test-WSMan Cmdlet 會提交識別要求,判斷 WinRM 服務是在本機或遠端電腦執行。如果受測試的電腦正在執行該服務,此 Cmdlet 會顯示受測試之服務的 WS-Management 識別架構、通訊協定版本、產品廠商和產品版本。</maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>Test-WSMan</maml:name> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。 重要:如果未指定驗證參數,則會以匿名方式將 Test-WSMan 要求傳送到遠端電腦 (不使用驗證)。如果 Test-WSMan 要求是以匿名方式提出,則不會傳回作業系統版本專屬的任何資訊。而且針對作業系統版本和 Service Pack 等級,Test-WSMan 會顯示 null 值 (OS: 0.0.0 SP: 0.0)。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Authentication</maml:name> <maml:description> <maml:para>指定用於伺服器的驗證機制。可能的值為: - Basic:Basic 是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。 - Default:使用 WS-Management 通訊協定所實作的驗證方法。 - Digest:Digest 是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。 - Kerberos:用戶端電腦與伺服器可使用 Kerberos 憑證相互驗證。 - Negotiate:Negotiate 是一種挑戰-回應配置,可與伺服器或 Proxy 進行交涉以決定要用於驗證的配置。例如,此參數值允許交涉式驗證判斷是使用 Kerberos 通訊協定還是 NTLM。 - CredSSP:使用認證安全性服務提供者 (CredSSP) 驗證,該驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。 重要:如果未指定驗證參數,則會以匿名方式將 Test-WSMan 要求傳送到遠端電腦 (不使用驗證)。如果 Test-WSMan 要求是以匿名方式提出,則不會傳回作業系統版本專屬的任何資訊。而且針對作業系統版本和 Service Pack 等級,Test-WSMan 會顯示 null 值 (OS: 0.0.0 SP: 0.0)。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">Authentication</command:parameterValue> <dev:type> <maml:name>Authentication</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1"> <maml:name>ComputerName</maml:name> <maml:description> <maml:para>指定要對其執行管理作業的電腦。此值可以是完整網域名稱、NetBIOS 名稱或 IP 位址。請使用本機電腦名稱、localhost 或點 (.) 指定本機電腦。本機電腦為預設值。當遠端電腦所在的網域與使用者的網域不同時,必須使用完整網域名稱。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para>指定具有執行此動作之權限的使用者帳戶。預設為目前使用者。請輸入使用者名稱,例如 "User01"、"Domain01\User01" 或 "User@Domain.com"。或者輸入 PSCredential 物件,例如 Get-Credential Cmdlet 所傳回的物件。當您輸入使用者名稱時,會提示您輸入密碼。</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不接受任何輸入。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>無</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 這個 Cmdlet 不會產生任何輸出物件。 </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> 根據預設,Test-WSMan Cmdlet 在查詢 WinRM 服務時不會使用驗證,而且不會傳回作業系統版本專屬的任何資訊,而且會針對作業系統版本和 Service Pack 等級顯示 null 值 (OS: 0.0.0 SP: 0.0)。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> test-wsman wsmid : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd ProductVendor : Microsoft Corporation ProductVersion : OS: 0.0.0 SP: 0.0 Stack: 2.0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會判斷 WinRM 服務是在本機電腦或遠端電腦執行。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 2 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> test-wsman -computername server01 wsmid : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd ProductVendor : Microsoft Corporation ProductVersion : OS: 0.0.0 SP: 0.0 Stack: 2.0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會判斷 WinRM 服務是否正在 server01 的電腦執行。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 3 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> test-wsman -authentication default wsmid : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd ProductVendor : Microsoft Corporation ProductVersion : OS: 6.0.6001 SP: 1.0 Stack: 2.0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會測試 WS-Management (WinRM) 服務是否使用驗證參數在本機電腦執行。 使用驗證參數可以讓 Test-WSMan Cmdlet 傳回作業系統版本。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 4 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> test-wsman -computername server01 -authentication default wsmid : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd ProductVendor : Microsoft Corporation ProductVersion : OS: 6.1.7021 SP: 0.0 Stack: 2.0 </dev:code> <dev:remarks> <maml:para>描述</maml:para> <maml:para>-----------</maml:para> <maml:para>這個命令會測試 WS-Management (WinRM) 服務是否使用驗證參數在名為 server01 的電腦執行。 使用驗證參數可以讓 Test-WSMan Cmdlet 傳回作業系統版本。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=141464</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-WSMan</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManCredSSP</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-WSManAction</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-WSManSessionOption</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManInstance</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-WSManQuickConfig</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> <!-- v 1.1.0.9 --> <providerHelp> <Name> WSMan </Name> <Drives> <Para>WSMan</Para> </Drives> <Synopsis> 提供 Web Services for Management (WS-Management) 設定資訊的存取權。 </Synopsis> <DetailedDescription> <para>Windows PowerShell 的 WS-Management 提供者可讓您新增、變更、清除及刪除本機或遠端電腦的 WS-Management 設定資料。 WS-Management 提供者會公開 Windows PowerShell 磁碟機,其中包含對應於 WS-Management 組態設定之邏輯群組的目錄結構。這些群組稱為容器。 -- Client 您可以設定 WS-Management 用戶端的各種層面。設定資訊會儲存在登錄中。 -- Service 您可以設定 WS-Management 服務的各種層面。設定資訊會儲存在登錄中。 注意:服務設定有時也稱為「伺服器設定」。 -- Shell 您可以設定 WS-Management 殼層的各種層面,例如允許遠端殼層存取 (AllowRemoteShellAccess) 以及允許的並行使用者數目上限 (MaxConcurrentUsers) 等設定。 -- Listener 您可以建立並設定接聽程式。接聽程式是實作 WS-Management 通訊協定以傳送及接收訊息的管理服務。 -- Plugin WS-Management 服務會載入並使用外掛程式來提供各種功能。Windows PowerShell 預設提供三個外掛程式:事件轉送外掛程式、Microsoft.PowerShell 外掛程式和 Windows Management Instrumentation (WMI) 提供者外掛程式。這三個外掛程式支援事件轉送、設定和 WMI 存取。 -- ClientCertificate 您可以建立並設定用戶端憑證。當 WS-Management 用戶端設定為使用憑證驗證時,便會使用用戶端憑證。 WS-Management 提供者的目錄階層 --------------- 本機電腦之 WS-Management 提供者的目錄階層如下: WSMan:\localhost --- Client --- Service --- Shell --- Listener ------ <特定接聽程式> --- Plugin ------ Event Forwarding Plugin --------- InitializationParameters --------- Resources ------------ Security ------ Microsoft.Powershell --------- InitializationParameters --------- Resources ------------ Security ------ WMI Provider --------- InitializationParameters --------- Resources ------------ Security --- ClientCertificate 遠端電腦之 WS-Management 提供者的目錄階層與本機電腦相同。不過,您必須使用 Connect-WSMan 建立與遠端電腦的連線,才能存取遠端電腦的組態設定。在建立與遠端電腦的連線之後,遠端電腦的名稱便會出現在提供者中。 WSMan:\<遠端電腦的名稱> --- Client --- Service --- Shell --- Listener ------ <特定接聽程式> --- Plugin ------ Event Forwarding Plugin --------- InitializationParameters --------- Resources ------------ Security ------ Microsoft.Powershell --------- InitializationParameters --------- Resources ------------ Security ------ WMI Provider --------- InitializationParameters --------- Resources ------------ Security --- ClientCertificate 自訂提供者說明 -------------------- Listener、Plugin (IntitializationParameters、Resources、Security) 和 ClientCertificate 提供者路徑可提供特定 New-Item 支援。請在相關路徑中輸入 "get-help New-Item" 以取得自訂說明。</para> </DetailedDescription> <Capabilities> <para></para> </Capabilities> <Filters> <para></para> </Filters> <Notes> </Notes> <Tasks> <Task> <Title> 瀏覽 WSMan: 磁碟機 </Title> <Description> <para></para> </Description> <Examples> <Example> <Title> -------------------------- 範例 1 -------------------------- </Title> <Introduction> <para>這個命令會使用 Set-Location Cmdlet,將目前位置變更為 WSMan: 磁碟機。</para> </Introduction> <Code> Set-Location WSMan: </Code> <Remarks> <para></para> </Remarks> </Example> <Example> <Title> -------------------------- 範例 2 -------------------------- </Title> <Introduction> <para>這個命令會使用 Set-Location 命令,將目前位置變更為 Localhost 存放區位置中的根目錄位置。請使用反斜線 (\) 或斜線 (/) 來指出 WSMan: 磁碟機的層級。</para> </Introduction> <Code> Set-Location -Path Localhost </Code> <Remarks> <para>如果您目前不在 WSMan: 磁碟機中,請在路徑開頭加上磁碟機名稱。</para> </Remarks> </Example> <Example> <Title> -------------------------- 範例 3 -------------------------- </Title> <Introduction> <para>這個命令會使用 Set-Location 命令,將目前位置變更為遠端系統存放區位置中的根目錄位置。請使用反斜線 (\) 或斜線 (/) 來指出 WSMan: 磁碟機的層級。</para> </Introduction> <Code> Set-Location -Path WSMan:\SERVER01 </Code> <Remarks> <para>如果您目前不在 WSMan: 磁碟機中,請在路徑開頭加上磁碟機名稱。 上述命令假設與遠端系統的連線已經存在。如果尚未建立與遠端系統的連線,則可在瀏覽到遠端系統存放區位置中的根目錄之前,立即建立連線。例如: WSMan-Connect SERVER01 Set-Location -Path WSMan:\SERVER01</para> </Remarks> </Example> <Example> <Title> -------------------------- 範例 4 -------------------------- </Title> <Introduction> <para>這個命令會使用 Set-Location 命令,將目前位置變更為 Localhost 存放區位置中的 Client 位置。請使用反斜線 (\) 或斜線 (/) 來指出 WSMan: 磁碟機的層級。</para> </Introduction> <Code> Set-Location -Path Localhost\Client </Code> <Remarks> <para>如果您目前不在 WSMan: 磁碟機中,請在路徑開頭加上磁碟機名稱。</para> </Remarks> </Example> </Examples> </Task> <Task> <Title> 顯示 WSMan: 磁碟機的內容 </Title> <Description> <para></para> </Description> <Examples> <Example> <Title> -------------------------- 範例 1 -------------------------- </Title> <Introduction> <para>這個命令會使用 Get-Childitem Cmdlet,顯示 Localhost 存放區位置中的 WS-Management 存放區。</para> </Introduction> <Code> get-childitem -path WSMan:\Localhost </Code> <Remarks> <para>如果您目前在 WSMan: 磁碟機中,則可省略磁碟機名稱。</para> </Remarks> </Example> <Example> <Title> -------------------------- 範例 2 -------------------------- </Title> <Introduction> <para>這個命令會使用 Get-Childitem Cmdlet,顯示遠端電腦 (SERVER01) 存放區位置中的 WS-Management 存放區。</para> </Introduction> <Code> get-childitem -path WSMan:\SERVER01 </Code> <Remarks> <para>如果您目前在 WSMan: 磁碟機中,則可省略磁碟機名稱。 上述命令假設與遠端系統的連線已經存在。如果尚未建立與遠端系統的連線,則可在顯示遠端系統存放區位置中的屬性和容器之前,立即建立連線。例如: WSMan-Connect SERVER01 get-childitem -path WSMan:\SERVER01</para> </Remarks> </Example> <Example> <Title> -------------------------- 範例 3 -------------------------- </Title> <Introduction> <para>這個命令會使用 Get-Childitem Cmdlet,顯示目前的 WS-Management 連線。</para> </Introduction> <Code> get-childitem -path WSMan:\ </Code> <Remarks> <para>如果您目前在 WSMan: 磁碟機中,則可省略磁碟機名稱。</para> </Remarks> </Example> <Example> <Title> -------------------------- 範例 4 -------------------------- </Title> <Introduction> <para>這個命令會使用 Get-Item Cmdlet,取得目前存放區中的屬性和容器。</para> </Introduction> <Code> Get-Childitem </Code> <Remarks> <para>上述命令會傳回屬性和內容的清單。例如: PS WSMan:\localhost> get-childitem WSManConfig: Microsoft.WSMan.Management\WSMan::localhost Name Value Type ---- ----- ---- MaxEnvelopeSizekb 150 System.String MaxTimeoutms 60000 System.String MaxBatchItems 32000 System.String MaxProviderRequests 4294967295 System.String Client Container Service Container Shell Container Listener Container Plugin Container ClientCertificate Container</para> </Remarks> </Example> </Examples> </Task> </Tasks> <DynamicParameters> <DynamicParameter> <Name>Address</Name> <CmdletSupported>Get-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定為其建立此接聽程式的位址。值可以是下列其中一項: -- 常值字串 "*" (萬用字元 (*) 會使命令繫結所有網路介面卡 [NIC] 上的所有 IP 位址)。 -- 常值字串 "IP:",後面再加上 IPv4 小數點十進位格式或 IPv6 冒號十六進位格式的有效 IP 位址。 -- 常值字串 "MAC:",後面再加上 NIC 的 MAC 位址。例如:MAC:32-a3-58-90-be-cc。 注意:此 Address 值是在建立接聽程式時設定。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>AllowRemoteShellAccess</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>啟用遠端殼層的存取。如果您將此參數設定為 False,伺服器便會拒絕新的遠端殼層連線。預設為 True。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>AllowUnEncrypted</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>允許用戶端電腦要求未加密的流量。根據預設,用戶端電腦需要加密的網路流量。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Arguments</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定您要傳遞到自訂殼層的引數字串和命令列引數。此參數為選擇項。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Basic</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>允許用戶端電腦使用基本驗證。基本驗證是一種以純文字格式將使用者名稱和密碼傳送到伺服器或 Proxy 的配置。這是最不安全的驗證方法。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Capability</Name> <CmdletSupported>Get-Item, New-Item, Remove-Item, Set-Item</CmdletSupported> <Type> <Name>Enumeration</Name> </Type> <Description>指定此統一資源識別項 (URI) 支援的作業。您必須為此 URI 支援的每一種作業建立一個項目。有效值如下: -- Create:URI 可支援 Create 作業。如果 Create 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Delete:URI 可支援 Delete 作業。如果 Delete 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Enumerate:URI 可支援 Enumerate 作業。Enumerate 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性有效,而且如果外掛程式支援篩選功能,此屬性必須設定為 True。這項作業不適用於也支援 Shell 作業的 URI。 -- Get:URI 可支援 Get 作業。如果 Get 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Invoke:URI 可支援 Invoke 作業。Invoke 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Put:URI 可支援 Put 作業。如果 Put 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Subscribe:URI 可支援 Subscribe 作業。Subscribe 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Shell:URI 可支援 Shell 作業。Shell 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援其他任何作業的 URI。若 URI 是設定為支援 Shell 作業,則會在 WS-Management (WinRM) 服務內部處理 Get、Put、Create、Delete、Invoke 和 Enumerate 作業來管理殼層。因此,外掛程式無法處理這些作業。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>CbtHardeningLevel</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>設定驗證要求中通道繫結權杖需求的原則。有效值如下: -- Strict:除非有通道繫結權杖,否則將拒絕所有要求。這項設定可利用通道繫結權杖來確保所有連線都安全無虞。 -- Relaxed:如果要求中有通道繫結權杖存在,連線便會受到保護。如果通道繫結權杖不存在,仍會接受連線。不過,這個連線很容易遭受通道繫結權杖能防止的攻擊。 -- None:忽略提供的任何通道繫結權杖。 此參數的值只對 HTTPS 連線有效。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>CertificateThumbprint</Name> <CmdletSupported>Clear-Item, Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定服務憑證的指紋。 這個值代表憑證之 Thumbprint 欄位中兩位數的十六進位值字串,用於指定有權執行此動作之使用者帳戶的數位公開金鑰憑證 (X509)。憑證係在進行用戶端憑證式驗證時使用。這些憑證可以對應到本機使用者帳戶,並不適用於網域帳戶。若要取得憑證指紋,請在 Windows PowerShell Cert: 磁碟機中使用 Get-Item 或 Get-ChildItem Cmdlet。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Certificate</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>允許使用用戶端來驗證憑證。WS-Management 用戶端會嘗試在電腦存放區中尋找憑證。如果用戶端在電腦存放區中找不到憑證,則會嘗試在目前的使用者存放區中尋找憑證。如果找不到符合的憑證,使用者會收到錯誤訊息。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>CredSSP</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>允許用戶端使用認證安全性服務提供者 (CredSSP) 驗證。 CredSSP 驗證允許使用者委派認證。此選項專為在一台遠端電腦執行,但卻從其他遠端電腦收集資料或執行其他命令的命令而設計。 警告:CredSSP 驗證會從本機電腦將使用者的認證委派給遠端電腦。此做法會提高遠端操作的安全性風險。如果遠端電腦已經遭受危害,當認證傳送到遠端電腦時,便可能遭到利用來控制網路工作階段。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>HTTP</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Short Integer</Name> </Type> <Description>指定使用 HTTP 時,用戶端要使用的連接埠。根據預設,HTTP 會使用連接埠 80,而您可以指定 1 到 65535 之間的任何值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>HTTPS</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Short Integer</Name> </Type> <Description>指定使用 HTTPS 時,用戶端要使用的連接埠。根據預設,HTTPS 會使用連接埠 443,而您可以指定 1 到 65535 之間的任何值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Digest</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>允許用戶端使用摘要式驗證。摘要式驗證是一種挑戰-回應配置,會使用伺服器指定的資料字串進行挑戰。只有用戶端電腦可以啟動摘要式驗證要求。用戶端電腦會將要求傳送到伺服器進行驗證,並接收伺服器傳回的權杖字串。接著,用戶端電腦會傳送資源要求,其中包括使用者名稱,以及結合權杖字串之密碼的編譯雜湊。HTTP 和 HTTPS 都可支援摘要式驗證。WinRM 殼層用戶端指令碼和應用程式可以指定摘要式驗證,但是 WS-Management 服務並不接受摘要式驗證。 注意:透過 HTTP 進行摘要式驗證並不安全。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Enabled</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>指定接聽程式處於啟用或停用狀態。預設為 True。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>ExactMatch</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>指定如何使用 Sddl 參數中指定的安全性設定。如果 ExactMatch 參數設定為 True,則只有在嘗試存取 URI 中指定的 URI 時,Sddl 中的安全性設定才會用來進行授權。如果 ExactMatch 設定為 false,則在嘗試存取以 URI 中指定之字串開頭的 URI 時,Sddl 中的安全性設定便會用來進行授權。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>FileName </Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定用來更新 ResourceURI 和 SelectorSet 所指定之管理資源的輸入檔。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>FileName (Plugin)</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定作業外掛程式的檔名。在收到要求時,置於此項目的任何環境變數都會在使用者的內容中展開。由於各個使用者都可能擁有相同環境變數的不同版本,因此都可能擁有不同的外掛程式。這個項目不能空白,而且必須指向有效的外掛程式。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>HostName</Name> <CmdletSupported>Clear-Item, Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定正在執行 WS-Management (WinRM) 服務之電腦的主機名稱。 這個值必須是完整網域名稱、IPv4 或 IPv6 常值字串,或是萬用字元。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>IdleTimeOut</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定當遠端殼層中沒有任何使用者活動時,遠端殼層保持開啟的時間上限 (毫秒)。在經過指定的時間之後,便會自動刪除遠端殼層。您可以指定 0 到 2147483647 之間的任何值。值為 0 表示逾時沒有限制。預設為 900000 (15 分鐘)。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>IPv4Filter</Name> <CmdletSupported>Clear-Item, Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定接聽程式可以使用的 IPv4 位址。有效值如下: -- 如果您將此參數保留空白,則無法使用任何 IPv4 位址。 -- 如果您輸入萬用字元 (*),則可以使用任何 IPv4 位址。 -- 如果您輸入 IP 範圍清單,則可以使用指定範圍內的任何 IP 位址。請使用逗號 (,) 來分隔各個範圍,並將每個範圍指定成一組使用小數點十進位格式且以連字號 (-) 分隔的 IPv4 位址。請務必將各組位址中較小的值放在前面。這些範圍包含頭尾值。 注意:IPv4 常值字串是由四個分別介於 0 到 255 之間的小數點十進位數字所組成,例如 192.168.0.0。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>IPv6Filter</Name> <CmdletSupported>Clear-Item, Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定接聽程式可以使用的 IPv6 位址。有效值如下: -- 如果您將此參數保留空白,則無法使用任何 IPv6 位址。 -- 如果您輸入萬用字元 (*),則可以使用任何 IPv6 位址。 -- 如果您輸入 IP 範圍清單,則可以使用指定範圍內的任何 IP 位址。請使用逗號 (,) 來分隔各個範圍,並將每個範圍指定成一組使用冒號十六進位格式且以連字號 (-) 分隔的 IPv6 位址。請務必將各組位址中較小的值放在前面。這些範圍包含頭尾值。 注意:IPv6 常值字串請置於方括號內,並包含以冒號分隔的十六進位數字,例如 [::1] 或 [3ffe:ffff::6ECB:0101]。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Issuer</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定發行憑證的憑證授權單位名稱。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Kerberos</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>允許用戶端使用 Kerberos 驗證。Kerberos 驗證是一種配置,讓用戶端與伺服器使用 Kerberos 憑證相互驗證。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>ListeningOn</Name> <CmdletSupported>Get-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定服務實際正在接聽的一個或所有 IP 位址。此參數衍生自以與接聽程式相關聯之實際 IP 為基礎的 Address 元素。IP 位址的值必須採用 IPv4 小數點十進位表示法或 IPv6 冒號分隔十六進位表示法。有多個 ListeningOn 項目存在,每個項目都以 ListeningOn_ 開頭。例如: ListeningOn_1201550598 ListeningOn_1973755898 ListeningOn_1508953035 ListeningOn_1560839940</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxBatchItems</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定 Pull 回應中可以使用的元素數目上限。您可以指定 1 到 4294967295 之間的任何值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxConcurrentUsers</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定可以透過遠端殼層在相同電腦上同時執行遠端作業的使用者數目上限。如果新的殼層連線數目超過指定的限制,便會遭到拒絕。您可以指定 1 到 100 之間的任何值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxEnvelopeSizekb</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定 SOAP 資料上限 (以 KB 為單位)。您可以指定 32 到 4294967295 之間的任何值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxMemoryPerShellMB</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定使用中遠端殼層及其所有子處理序能配置的記憶體總容量上限。您可以指定 0 到 2147483647 之間的任何值。值為 0 表示遠端作業僅能以可用的虛擬記憶體來配置記憶體。預設值為 0。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxProcessesPerShell</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定允許任何殼層作業啟動的處理序數目上限。您可以指定 0 到 2147483647 之間的任何數字。值為 0 表示允許的處理序數目不受限制。根據預設,每個殼層的上限是五個處理序。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxProviderRequests</Name> <CmdletSupported>Get-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定服務允許的同時要求數目上限。您可以指定 1 到 4294967295 之間的任何值。此限制適用於各個提供者。 注意:這個值已被取代,不應該使用。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxShellsPerUser</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定任何使用者可以透過遠端方式,在相同系統上開啟之並行殼層數目的上限。啟用這個原則設定後,如果此計數超過指定的限制,使用者便無法開啟新的遠端殼層。如果已停用或未設定這個原則設定,此限制將預設為每個使用者可開啟兩個遠端殼層。您可以指定 0 到 2147483647 之間的任何數字。值為 0 表示允許的殼層數目不受限制。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxTimeoutMs</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定除了 Pull 要求以外的任何要求所需的逾時上限 (毫秒)。您可以指定 500 到 4294967295 之間的任何數字。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Name</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定 WS-Management 工作階段的顯示名稱。您可以在使用其他 Cmdlet (例如 Get-PSSession 和 Enter-PSSession) 時,使用此名稱來表示工作階段。此名稱不一定要是電腦或目前工作階段的唯一名稱。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Name (Plugin)</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定要用於外掛程式的顯示名稱。如果外掛程式傳回錯誤,此顯示名稱會放入傳回到用戶端應用程式的錯誤 XML 中。此名稱與地區設定無關。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Negotiate</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>允許用戶端使用交涉式驗證。交涉式驗證是一種配置,用戶端會傳送要求到伺服器進行驗證。伺服器會決定要使用 Kerberos 通訊協定還是 NTLM。伺服器會選取 Kerberos 通訊協定來驗證網域帳戶,並選取 NTLM 來驗證本機電腦帳戶。網域使用者的使用者名稱必須以 domain\user_name 的格式來指定。若是伺服器電腦上的本機使用者,則使用者名稱必須以 server_name\user_name 的格式來指定。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>NetworkDelayMs</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定用戶端電腦因為考慮到網路延遲時間而等待的額外時間 (毫秒)。您可以指定 500 到 4294967295 之間的任何值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Password</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定本機或網域帳戶的密碼。此值不可為 NULL。 用戶端電腦可以指定在電腦上建立殼層時所要使用的認證。網域使用者的使用者名稱必須以 domain\user_name 的格式來指定。若是伺服器電腦上的本機使用者,則使用者名稱必須以 server_name\user_name 的格式來指定。 如果您使用這個結構,就必須同時指定使用者名稱和密碼欄位。此結構可用於基本、摘要式、交涉式或 Kerberos 驗證。使用基本或摘要式驗證時,用戶端必須明確指定認證。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Plugin</Name> <CmdletSupported>New-Item, Remove-Item</CmdletSupported> <Type> <Name></Name> </Type> <Description>WS-Management 外掛程式是原生動態連結程式庫 (DLL),其外掛於 WS-Management 並可擴充其功能。WSW-Management 外掛程式 API 可提供功能,讓使用者針對支援的資源 URI 和作業實作特定 API,以便撰寫外掛程式。針對 WS-Management (WinRM) 服務或 Internet Information Services (IIS) (IIS) 設定外掛程式之後,這些外掛程式便會分別載入 WS-Management 主機或 IIS 主機中。遠端要求會通過路由傳送到這些外掛程式進入點來執行作業。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Port</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Short Integer</Name> </Type> <Description>指定為其建立此接聽程式的 TCP 連接埠。您可以指定 1 到 65535 之間的任何值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Resource</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定代表特殊管理作業類型或值型別的端點。服務會公開一個或多個資源,而且某些資源可以有一個以上的執行個體。管理資源類似於 WMI 類別或資料庫資料表,而執行個體則與類別的執行個體或資料表中的資料列類似。例如,Win32_LogicalDisk 類別代表資源,Win32_LogicalDisk="C:\" 則是該項資源的特定執行個體。 統一資源識別項 (URI) 包含首碼和資源路徑。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>ResourceURI</Name> <CmdletSupported>Get-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定用來識別電腦上特定資源類型 (如磁碟或處理序) 的統一資源識別項 (URI)。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>RootSDDL</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定存取控制項目的安全性描述元定義語言 (SDDL)。此參數可識別用來授權存取指定之資源 URI 的安全性設定。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>SDKVersion</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定 WS-Management 外掛程式 SDK 的版本。唯一的有效值是 1。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Shell</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定自訂殼層的處理序字串。您可以指定環境變數。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>ShellTimeout</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>指定由於閒置導致殼層逾時的時間長度。請指定以毫秒為單位的逾時值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Subject</Name> <CmdletSupported>Get-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定憑證所識別的實體。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>SupportsOptions</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Boolean</Name> </Type> <Description>指定外掛程式是否支援使用在要求訊息之 wsman:OptionSet 標頭內傳送的選項。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Transport</Name> <CmdletSupported>Get-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定用來傳送及接收 WS-Management 通訊協定要求和回應的傳輸協定。值必須是 HTTP 或 HTTPS。 注意:此 Transport 值是在建立接聽程式時設定。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>TrustedHosts</Name> <CmdletSupported>Clear-Item, Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>透過信任的網路連線連接到本機電腦的遠端電腦清單。使用不允許用戶端驗證服務的驗證配置和傳輸協定 (例如基本驗證或 HTTP) 時,允許將要求傳送到這份清單中指定的電腦。 如果在 TrustedHosts 中指定伺服器,用戶端不會驗證伺服器的身分識別,而讓用戶端很容易遭受攔截式攻擊。建議只有在沒有惡意使用者的安全網路連線中 (例如在網域環境中),才指定主機名稱。 指定的主機名稱可以是網域名稱系統 (DNS) 名稱或 IP 位址。有效值如下: -- 空白:不信任任何主機。 -- 星號 "*" 字元:信任所有主機。 以逗號 (,) 分隔的主機名稱模式清單。主機名稱模式必須使用下列格式: -- 以萬用字元 (*) 開頭的字串。此字串至少必須包含兩個字元。如此表示信任共用此尾碼的所有主機。 -- 以萬用字元 (*) 結尾的字串。此字串至少必須包含兩個字元。如此表示信任共用此首碼的所有主機。 -- 信任所有的 NetBIOS 名稱 (例如,不包含句號的字串)。 -- 不含萬用字元的字串 (*):信任以此字串命名的主機。 注意:使用 Set-Item Cmdlet 設定 TrustedHosts 值時,Set-Item Cmdlet 另外還支援 -Concatenate 參數。下列範例會將新值 (*.domain2.com) 附加到儲存在 TrustedHost 中的舊值: Set-Item .\TrustedHosts *.domain2.com -Concatenate -Force</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>URI</Name> <CmdletSupported>Get-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>識別依據 Sddl 參數值授權存取的 URI。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>URLPrefix</Name> <CmdletSupported>Clear-Item, Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>可接受 HTTP 或 HTTPS 要求的 URL 首碼。這是只包含字元 a-z、A-Z、9-0、底線 (_) 和反斜線 (/) 的字串。此字串不能以反斜線 (/) 開頭或結尾。例如,如果電腦名稱是 SampleComputer,WS-Management 用戶端就要在目的位址中指定 http://SampleMachine/URLPrefix。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>UserName</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定本機帳戶或網域帳戶的使用者名稱。值不能為 NULL。 用戶端可以指定在電腦上建立殼層時所要使用的認證。網域帳戶的使用者名稱必須以 domain\user_name 的格式來指定。若是伺服器電腦上的本機帳戶,則使用者名稱必須以 server_name\user_name 的格式來指定。 如果使用這個結構,就必須同時指定使用者名稱和密碼欄位。此結構可用於基本、摘要式、交涉式或 Kerberos 驗證。使用基本或摘要式驗證時,用戶端必須明確指定認證。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>Value</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定初始化參數的值,這是用來指定設定選項的外掛程式專屬值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>XMLRenderingType</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>指定透過 WSMAN_DATA 物件將 XML 傳送到外掛程式時所使用的格式。有效值如下: Text:內送 XML 資料包含在 WSMAN_DATA_TYPE_TEXT 結構中,將 XML 表示成 PCWSTR 記憶體緩衝區。 XMLReader:內送 XML 資料包含在 WSMAN_DATA_TYPE_WS_XML_READER 結構中,將 XML 表示成 WebServices.h 標頭檔中定義的 XmlReader 物件。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>xmlns</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>字串,指定可唯一識別命名空間的統一資源名稱 (URN)。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>lang</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>String</Name> </Type> <Description>字串,指定語言,或是以連字號分隔語言及地區的「語言-地區」。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>HTTP</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Short Integer</Name> </Type> <Description>指定使用 HTTP 時,用戶端要使用的連接埠。根據預設,HTTP 會使用連接埠 80,而您可以指定 1 到 65535 之間的任何值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>HTTPS</Name> <CmdletSupported>Get-Item, Set-Item</CmdletSupported> <Type> <Name>Short-Integer</Name> </Type> <Description>指定使用 HTTPS 時,用戶端要使用的連接埠。根據預設,HTTPS 會使用連接埠 443,而您可以指定 1 到 65535 之間的任何值。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxShellRunTime</Name> <CmdletSupported>Get-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>注意:這個值已被取代,已經不再使用。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> <DynamicParameter> <Name>MaxShellRunTime</Name> <CmdletSupported>Get-Item</CmdletSupported> <Type> <Name>Unsigned Long Integer</Name> </Type> <Description>注意:這個值已被取代,不應該使用。</Description> <PossibleValues> <PossibleValue> <Value></Value> <Description> <para></para> </Description> </PossibleValue> </PossibleValues> </DynamicParameter> </DynamicParameters> <RelatedLinks> <navigationLink> <linkText></linkText> <uri /> </navigationLink> </RelatedLinks> <CmdletHelpPaths> <CmdletHelpPath ID="ClientCertificate"> <!-- v 1.1.0.9 --> <!-- New-Item --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> New-Item </command:name> <maml:description> <maml:para>建立新項目。New-Item 命令會在這個位置建立新的用戶端憑證。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>Item</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para> New-Item Cmdlet 會建立新項目並且設定項目的值。可以建立的項目類型會視項目的位置而異。 在 ClientCertificate 目錄中,您可以使用 New-Item Cmdlet 來建立及設定用戶端憑證。當 WS-Management 用戶端設定為使用憑證驗證時,便會使用用戶端憑證。 </maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>New-Item</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Issuer</maml:name> <maml:description> <maml:para> 指定發行憑證的憑證授權單位名稱。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Subject</maml:name> <maml:description> <maml:para> 指定憑證所識別的實體。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para> 指定用來識別電腦上特定資源類型 (如磁碟或處理序) 的統一資源識別項 (URI)。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">Uri</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para> 指定本機或網域帳戶的認證。此值不可為 NULL。 用戶端電腦可以指定在電腦上建立殼層時所要使用的認證。網域使用者的使用者名稱必須以 domain\user_name 的格式來指定。若是伺服器電腦上的本機使用者,則使用者名稱必須以 server_name\user_name 的格式來指定。 如果您使用這個結構,就必須同時指定使用者名稱和密碼欄位。此結構可用於基本、摘要式、交涉式或 Kerberos 驗證。使用基本或摘要式驗證時,用戶端必須明確指定認證。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">PSCredential</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Issuer</maml:name> <maml:description> <maml:para> 指定發行憑證的憑證授權單位名稱。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Subject</maml:name> <maml:description> <maml:para> 指定憑證所識別的實體。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para> 指定用來識別電腦上特定資源類型 (如磁碟或處理序) 的統一資源識別項 (URI)。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Credential</maml:name> <maml:description> <maml:para> 指定本機或網域帳戶的認證。此值不可為 NULL。 用戶端電腦可以指定在電腦上建立殼層時所要使用的認證。網域使用者的使用者名稱必須以 domain\user_name 的格式來指定。若是伺服器電腦上的本機使用者,則使用者名稱必須以 server_name\user_name 的格式來指定。 如果您使用這個結構,就必須同時指定使用者名稱和密碼欄位。此結構可用於基本、摘要式、交涉式或 Kerberos 驗證。使用基本或摘要式驗證時,用戶端必須明確指定認證。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 您可以經由管道將新項目的值輸出至 New-Item Cmdlet。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Any</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> New-Item Cmdlet 設計的用意是要操作任一提供者所公開的資料。若要列出可在工作階段中使用的提供者,請輸入 "Get-PsProvider"。如需詳細資訊,請參閱 About_Providers。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> $cred = Get-Credential New-Item -Path WSMan:\localhost\ClientCertificate -Issuer 1b3fd224d66c6413fe20d21e38b304226d192dfe -URI wmicimv2/* -Credential $cred; </dev:code> <dev:remarks> <maml:para> 這個命令會建立可供 WS-Management 用戶端使用的 ClientCertificate 項目。新的 ClientCertificate 將會出現在 ClientCertificate 目錄底下,並顯示成 ClientCertificate_1234567890。所有的參數都是必要項。Issuer 必須是簽發者憑證的指紋。 </maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=145854</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Providers</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Rename-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Move-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Copy-Item</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> </CmdletHelpPath> <CmdletHelpPath ID="Listener"> <!-- v 1.1.0.9 --> <!-- New-Item --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> New-Item </command:name> <maml:description> <maml:para>建立新項目。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>Item</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para> New-Item Cmdlet 會建立新項目並且設定項目的值。可以建立的項目類型會視項目的位置而異。例如在檔案系統中,New-Item 會用於建立檔案和資料夾。在登錄中,New-Item 會建立登錄機碼與項目。 New-Item 也可以設定其所建立之項目的值。例如,建立新檔案時,New-Item 可以將初始內容新增到檔案中。 </maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>New-Item</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Address</maml:name> <maml:description> <maml:para> 指定為其建立此接聽程式的位址。值可以是下列其中一項: -- 常值字串 "*" (萬用字元 (*) 會使命令繫結所有網路介面卡 [NIC] 上的所有 IP 位址)。 -- 常值字串 "IP:",後面再加上 IPv4 小數點十進位格式或 IPv6 冒號十六進位格式的有效 IP 位址。 -- 常值字串 "MAC:",後面再加上 NIC 的 MAC 位址。例如:MAC:32-a3-58-90-be-cc。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Transport</maml:name> <maml:description> <maml:para> 指定用來傳送及接收 WS-Management 通訊協定要求和回應的傳輸協定。值必須是 HTTP 或 HTTPS。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Hostname</maml:name> <maml:description> <maml:para> 指定正在執行 WS-Management (WinRM) 服務之電腦的主機名稱。 這個值必須是完整網域名稱、IPv4 或 IPv6 常值字串,或是萬用字元。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Enabled</maml:name> <maml:description> <maml:para> 指定接聽程式處於啟用或停用狀態。預設為 True。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>URLPrefix</maml:name> <maml:description> <maml:para> 可接受 HTTP 或 HTTPS 要求的 URL 首碼。這是只包含字元 a-z、A-Z、9-0、 底線 (_) 和反斜線 (/) 的字串。此字串不能以反斜線 (/) 開頭或結尾。例如,如果電腦 名稱是 SampleMachine,WS-Management 用戶端就要在目的位址中指定 http://SampleMachine/URLPrefix。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>CertificateThumbprint</maml:name> <maml:description> <maml:para> 指定服務憑證的指紋。 這個值代表憑證之 Thumbprint 欄位中兩位數的十六進位值字串,用於指定 有權執行此動作之使用者帳戶的數位公開金鑰憑證 (X509)。憑證係在 進行用戶端憑證式驗證時使用。這些憑證只能對應到本機使用者帳戶,並不適用於網域 帳戶。若要取得憑證指紋,請在 Windows PowerShell Cert: 磁碟機中使用 Get-Item 或 Get-ChildItem Cmdlet。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Address</maml:name> <maml:description> <maml:para> 指定為其建立此接聽程式的位址。值可以是下列其中一項: -- 常值字串 "*" (萬用字元 (*) 會使命令繫結所有網路介面卡 [NIC] 上的所有 IP 位址)。 -- 常值字串 "IP:",後面再加上 IPv4 小數點十進位格式或 IPv6 冒號十六進位格式的有效 IP 位址。 -- 常值字串 "MAC:",後面再加上 NIC 的 MAC 位址。例如:MAC:32-a3-58-90-be-cc。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Transport</maml:name> <maml:description> <maml:para> 指定用來傳送及接收 WS-Management 通訊協定要求和回應的傳輸協定。值必須是 HTTP 或 HTTPS。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Hostname</maml:name> <maml:description> <maml:para> 指定正在執行 WS-Management (WinRM) 服務之電腦的主機名稱。 這個值必須是完整網域名稱、IPv4 或 IPv6 常值字串,或是萬用字元。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Enabled</maml:name> <maml:description> <maml:para> 指定接聽程式處於啟用或停用狀態。預設為 True。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>URLPrefix</maml:name> <maml:description> <maml:para> 可接受 HTTP 或 HTTPS 要求的 URL 首碼。這是只包含字元 a-z、A-Z、9-0、 底線 (_) 和反斜線 (/) 的字串。此字串不能以反斜線 (/) 開頭或結尾。例如,如果電腦 名稱是 SampleMachine,WS-Management 用戶端就要在目的位址中指定 http://SampleMachine/URLPrefix。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>CertificateThumbprint</maml:name> <maml:description> <maml:para> 指定服務憑證的指紋。 這個值代表憑證之 Thumbprint 欄位中兩位數的十六進位值字串,用於指定 有權執行此動作之使用者帳戶的數位公開金鑰憑證 (X509)。憑證係在 進行用戶端憑證式驗證時使用。這些憑證只能對應到本機使用者帳戶,並不適用於網域 帳戶。若要取得憑證指紋,請在 Windows PowerShell Cert: 磁碟機中使用 Get-Item 或 Get-ChildItem Cmdlet。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 您可以經由管道將新項目的值輸出至 New-Item Cmdlet。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Any</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> New-Item Cmdlet 設計的用意是要操作任一提供者所公開的資料。若要列出可在工作階段中使用的提供者,請輸入 "Get-PsProvider"。如需詳細資訊,請參閱 About_Providers。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> New-Item -Path WSMan:\localhost\Listener -Address * -Transport HTTP -force </dev:code> <dev:remarks> <maml:para>這個命令會針對電腦的所有 IP 位址建立 HTTP 接聽程式。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=145853</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Providers</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Rename-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Move-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Copy-Item</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> </CmdletHelpPath> <CmdletHelpPath ID="Plugin"> <!-- v 1.1.0.9 --> <!-- New-Item --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> New-Item </command:name> <maml:description> <maml:para>建立新項目。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>Item</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para> New-Item Cmdlet 會建立新項目並且設定項目的值。可以建立的項目類型會視項目的位置而異。例如在檔案系統中,New-Item 會用於建立檔案和資料夾。在登錄中,New-Item 會建立登錄機碼與項目。 New-Item 也可以設定其所建立之項目的值。例如,建立新檔案時,New-Item 可以將初始內容新增到檔案中。 </maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>New-Item</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Plugin</maml:name> <maml:description> <maml:para> 指定要用於外掛程式的顯示名稱。如果外掛程式傳回錯誤,此顯示名稱會 放入傳回到用戶端應用程式的錯誤 XML 中。此名稱與地區設定無關。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Filename</maml:name> <maml:description> <maml:para> 指定作業外掛程式的檔名。在收到要求時,置於此項目的任何環境變數都會在使用者的內容中展開。由於各個使用者可能擁有相同環境變數的不同版本, 因此都可能擁有不同的外掛程式。這個項目不能空白,而且必須指向有效的外掛程式。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para> 指定用來識別電腦上特定資源類型 (如磁碟或處理序) 的統一資源識別項 (URI)。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">Uri</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Capability</maml:name> <maml:description> <maml:para> 指定此統一資源識別項 (URI) 支援的作業。您必須為此 URI 支援的每一種作業建立一個項目。有效值如下: -- Create:URI 可支援 Create 作業。如果 Create 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Delete:URI 可支援 Delete 作業。如果 Delete 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Enumerate:URI 可支援 Enumerate 作業。Enumerate 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性有效,而且如果外掛程式支援篩選功能,此屬性必須設定為 True。這項作業不適用於也支援 Shell 作業的 URI。 -- Get:URI 可支援 Get 作業。如果 Get 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Invoke:URI 可支援 Invoke 作業。Invoke 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Put:URI 可支援 Put 作業。如果 Put 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Subscribe:URI 可支援 Subscribe 作業。Subscribe 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Shell:URI 可支援 Shell 作業。Shell 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援其他任何作業的 URI。若 URI 是設定為支援 Shell 作業,則會在 WS-Management (WinRM) 服務內部處理 Get、Put、Create、Delete、Invoke 和 Enumerate 作業來管理殼層。因此,外掛程式無法處理這些作業。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>lang</maml:name> <maml:description> <maml:para> 字串,指定語言,或是以連字號分隔語言及地區的「語言-地區」。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>SDKVersion</maml:name> <maml:description> <maml:para> 指定 WS-Management 外掛程式 SDK 的版本。唯一的有效值是 1。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>xmlns</maml:name> <maml:description> <maml:para> 字串,指定可唯一識別命名空間的統一資源名稱 (URN)。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>XMLRenderingType</maml:name> <maml:description> <maml:para> 指定透過 WSMAN_DATA 物件將 XML 傳送到外掛程式時所使用的格式。有效值如下: Text:內送 XML 資料包含在 WSMAN_DATA_TYPE_TEXT 結構中,將 XML 表示成 PCWSTR 記憶體緩衝區。 XMLReader:內送 XML 資料包含在 WSMAN_DATA_TYPE_WS_XML_READER 結構中,將 XML 表示成 WebServices.h 標頭檔中定義的 XmlReader 物件。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Plugin</maml:name> <maml:description> <maml:para> 指定要用於外掛程式的顯示名稱。如果外掛程式傳回錯誤,此顯示名稱會 放入傳回到用戶端應用程式的錯誤 XML 中。此名稱與地區設定無關。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>FileName</maml:name> <maml:description> <maml:para> 指定作業外掛程式的檔名。在收到要求時,置於此項目的任何環境變數都會在使用者的內容中展開。由於各個使用者可能擁有相同環境變數的不同版本, 因此都可能擁有不同的外掛程式。這個項目不能空白,而且必須指向有效的外掛程式。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para> 指定用來識別電腦上特定資源類型 (如磁碟或處理序) 的統一資源識別項 (URI)。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Capability</maml:name> <maml:description> <maml:para> 指定此統一資源識別項 (URI) 支援的作業。您必須為此 URI 支援的每一種作業建立一個項目。有效值如下: -- Create:URI 可支援 Create 作業。如果 Create 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Delete:URI 可支援 Delete 作業。如果 Delete 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Enumerate:URI 可支援 Enumerate 作業。Enumerate 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性有效,而且如果外掛程式支援篩選功能,此屬性必須設定為 True。這項作業不適用於也支援 Shell 作業的 URI。 -- Get:URI 可支援 Get 作業。如果 Get 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Invoke:URI 可支援 Invoke 作業。Invoke 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Put:URI 可支援 Put 作業。如果 Put 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Subscribe:URI 可支援 Subscribe 作業。Subscribe 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Shell:URI 可支援 Shell 作業。Shell 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援其他任何作業的 URI。若 URI 是設定為支援 Shell 作業,則會在 WS-Management (WinRM) 服務內部處理 Get、Put、Create、Delete、Invoke 和 Enumerate 作業來管理殼層。因此,外掛程式無法處理這些作業。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>lang</maml:name> <maml:description> <maml:para> 字串,指定語言,或是以連字號分隔語言及地區的「語言-地區」。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>SDKVersion</maml:name> <maml:description> <maml:para> 指定 WS-Management 外掛程式 SDK 的版本。唯一的有效值是 1。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>xmlns</maml:name> <maml:description> <maml:para> 字串,指定可唯一識別命名空間的統一資源名稱 (URN)。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>XMLRenderingType</maml:name> <maml:description> <maml:para> 指定透過 WSMAN_DATA 物件將 XML 傳送到外掛程式時所使用的格式。有效值如下: Text:內送 XML 資料包含在 WSMAN_DATA_TYPE_TEXT 結構中,將 XML 表示成 PCWSTR 記憶體緩衝區。 XMLReader:內送 XML 資料包含在 WSMAN_DATA_TYPE_WS_XML_READER 結構中,將 XML 表示成 WebServices.h 標頭檔中定義的 XmlReader 物件。 </maml:para> </maml:description> <command:parameterValue required="true" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 您可以經由管道將新項目的值輸出至 New-Item Cmdlet。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Any</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> New-Item Cmdlet 設計的用意是要操作任一提供者所公開的資料。若要列出可在工作階段中使用的提供者,請輸入 "Get-PsProvider"。如需詳細資訊,請參閱 About_Providers。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> New-Item -Path WSMan:\localhost\Plugin -Force -Name "Test Plugin" -File C:\Testplugin.xml Where Testplugin.xml contains: <PlugInConfiguration xmlns="http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration" Name="Test Plugin" Filename="%systemroot%\system32\WSManTestPlugin.dll" Architecture="32" SDKVersion="1" XmlRenderingType="text"> <InitializationParameters> <Param Name="PSVersion" Value="2.0" /> </InitializationParameters> <Resources> <Resource ResourceUri="http://microsoft.test.wsman" SupportsOptions="true"> <Security xmlns="http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration" Uri="http://microsoft.test.wsman/test" ExactMatch="true" Sddl="O:NSG:BAD:P(A;;GA;;;WD)" /> <Capability Type="Get" SupportsFragment="true" /> <Capability Type="Put" SupportsFragment="true" /> <Capability Type="Create" SupportsFragment="true" /> <Capability Type="Delete" SupportsFragment="true" /> <Capability Type="Invoke" /> <Capability Type="Enumerate" SupportsFiltering="true" /> <Capability Type="Subscribe" SupportsFiltering="true" /> </Resource> <Resource ResourceUri="http://microsoft.test/test" SupportsOptions="true"> <Capability Type="Shell" /> </Resource> </Resources> </PlugInConfiguration> </dev:code> <dev:remarks> <maml:para>這個命令會建立 (註冊) WS-Management 服務的外掛程式。範例中使用 XML 檔案載入所有的必要設定,以建立外掛程式。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> <command:example> <maml:title> -------------------------- 範例 2 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> New-Item -Path WSMan:\localhost\Plugin -Plugin TestPlugin -FileName %systemroot%\system32\WsmWmiPl.dll -Resource http://schemas.dmtf.org/wbem/wscim/2/cim-schema -SDKVersion 1 -Capability "Get","Put","Invoke","Enumerate" -XMLRenderingType text </dev:code> <dev:remarks> <maml:para>這個命令會建立 (註冊) WS-Management 服務的外掛程式。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=145852</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Providers</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Rename-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Move-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Copy-Item</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> </CmdletHelpPath> <CmdletHelpPath ID="InitializationParameters"> <!-- v 1.1.0.9 --> <!-- New-Item --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> New-Item </command:name> <maml:description> <maml:para>建立新項目。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>Item</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para> New-Item Cmdlet 會建立新項目並且設定項目的值。可以建立的項目類型會視項目的位置而異。例如在檔案系統中,New-Item 會用於建立檔案和資料夾。在登錄中,New-Item 會建立登錄機碼與項目。 在 InitializationParameters 目錄中,您可以使用 New-Item Cmdlet 來建立及設定 Plugin 的初始化參數。 </maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>New-Item</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ParamName</maml:name> <maml:description> <maml:para> 指定要用於初始化參數的顯示名稱。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ParamValue</maml:name> <maml:description> <maml:para> 指定初始化參數的值,這是用來指定設定選項的外掛程式專屬值。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ParamName</maml:name> <maml:description> <maml:para> 指定要用於初始化參數的顯示名稱。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ParamValue</maml:name> <maml:description> <maml:para> 指定初始化參數的值,這是用來指定設定選項的外掛程式專屬值。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 您可以經由管道將新項目的值輸出至 New-Item Cmdlet。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Any</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> New-Item Cmdlet 設計的用意是要操作任一提供者所公開的資料。若要列出可在工作階段中使用的提供者,請輸入 "Get-PsProvider"。如需詳細資訊,請參閱 About_Providers。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code> New-Item -Path WSMan:\localhost\Plugin\TestPlugin\InitializationParameters -ParamName testparametername -ParamValue testparametervalue</dev:code> <dev:remarks> <maml:para>這個命令會在 InitializationParameters 目錄中建立名為 testparametername 的初始化參數。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=145851</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Providers</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Rename-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Move-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Copy-Item</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> </CmdletHelpPath> <CmdletHelpPath ID="Resources"> <!-- v 1.1.0.9 --> <!-- New-Item --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> New-Item </command:name> <maml:description> <maml:para>建立新項目。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>Item</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para> New-Item Cmdlet 會建立新項目並且設定項目的值。可以建立的項目類型會視項目的位置而異。例如在檔案系統中,New-Item 會用於建立檔案和資料夾。在登錄中,New-Item 會建立登錄機碼與項目。 在 Resources 目錄中,您可以使用 New-Item Cmdlet 來建立及設定 Plugin 的資源。 </maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>New-Item</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para> 指定用來識別電腦上特定資源類型 (如磁碟或處理序) 的統一資源識別項 (URI)。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>SupportsOptions</maml:name> <maml:description> <maml:para> 指定外掛程式是否支援使用在要求訊息之 wsman:OptionSet 標頭內傳送的選項。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ExactMatch</maml:name> <maml:description> <maml:para> 指定如何使用 Sddl 參數中指定的安全性設定。如果 ExactMatch 參數設定為 True, 則只有在嘗試存取 URI 中指定的 URI 時,Sddl 中的安全性設定才會用來進行授權。如果 ExactMatch 設定為 false,則在嘗試存取以 URI 中指定之字串開頭的 URI 時,Sddl 中的安全性設定便會 用來進行授權。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Capability</maml:name> <maml:description> <maml:para> 指定此統一資源識別項 (URI) 支援的作業。您必須為此 URI 支援的每一種作業建立一個項目。有效值如下: -- Create:URI 可支援 Create 作業。如果 Create 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Delete:URI 可支援 Delete 作業。如果 Delete 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Enumerate:URI 可支援 Enumerate 作業。Enumerate 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性有效,而且如果外掛程式支援篩選功能,此屬性必須設定為 True。這項作業不適用於也支援 Shell 作業的 URI。 -- Get:URI 可支援 Get 作業。如果 Get 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Invoke:URI 可支援 Invoke 作業。Invoke 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Put:URI 可支援 Put 作業。如果 Put 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Subscribe:URI 可支援 Subscribe 作業。Subscribe 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Shell:URI 可支援 Shell 作業。Shell 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援其他任何作業的 URI。若 URI 是設定為支援 Shell 作業,則會在 WS-Management (WinRM) 服務內部處理 Get、Put、Create、Delete、Invoke 和 Enumerate 作業來管理殼層。因此,外掛程式無法處理這些作業。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para> 在執行命令前先提示確認。 </maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ResourceURI</maml:name> <maml:description> <maml:para> 指定用來識別電腦上特定資源類型 (如磁碟或處理序) 的統一資源識別項 (URI)。 URI 由首碼和資源路徑組成。例如: http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_LogicalDisk http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_NumericSensor </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>SupportsOptions</maml:name> <maml:description> <maml:para> 指定外掛程式是否支援使用在要求訊息之 wsman:OptionSet 標頭內傳送的選項。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ExactMatch</maml:name> <maml:description> <maml:para> 指定如何使用 Sddl 參數中指定的安全性設定。如果 ExactMatch 參數設定為 True, 則只有在嘗試存取 URI 中指定的 URI 時,Sddl 中的安全性設定才會用來進行授權。如果 ExactMatch 設定為 false,則在嘗試存取以 URI 中指定之字串開頭的 URI 時,Sddl 中的安全性設定便會 用來進行授權。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>Capability</maml:name> <maml:description> <maml:para> 指定此統一資源識別項 (URI) 支援的作業。您必須為此 URI 支援的每一種作業建立一個項目。有效值如下: -- Create:URI 可支援 Create 作業。如果 Create 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Delete:URI 可支援 Delete 作業。如果 Delete 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Enumerate:URI 可支援 Enumerate 作業。Enumerate 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性有效,而且如果外掛程式支援篩選功能,此屬性必須設定為 True。這項作業不適用於也支援 Shell 作業的 URI。 -- Get:URI 可支援 Get 作業。如果 Get 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Invoke:URI 可支援 Invoke 作業。Invoke 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Put:URI 可支援 Put 作業。如果 Put 作業支援使用 SupportFragment 屬性的概念,則會使用該屬性。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Subscribe:URI 可支援 Subscribe 作業。Subscribe 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援 Shell 作業的 URI。 -- Shell:URI 可支援 Shell 作業。Shell 作業不支援 SupportFragment 屬性,此屬性必須設定為 False。SupportFiltering 屬性無效,必須設定為 False。這項作業不適用於也支援其他任何作業的 URI。若 URI 是設定為支援 Shell 作業,則會在 WS-Management (WinRM) 服務內部處理 Get、Put、Create、Delete、Invoke 和 Enumerate 作業來管理殼層。因此,外掛程式無法處理這些作業。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 您可以經由管道將新項目的值輸出至 New-Item Cmdlet。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Any</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> New-Item Cmdlet 設計的用意是要操作任一提供者所公開的資料。若要列出可在工作階段中使用的提供者,請輸入 "Get-PsProvider"。如需詳細資訊,請參閱 About_Providers。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code>New-Item -Path WSMan:\localhost\Plugin\TestPlugin\Resources -ResourceUri http://schemas.dmtf.org/wbem/wscim/3/cim-schema -Capability "Enumerate"</dev:code> <dev:remarks> <maml:para>這個命令會在 TestPlugin 的 Resources 目錄中建立資源項目。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=145850</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Providers</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Rename-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Move-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Copy-Item</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> </CmdletHelpPath> <CmdletHelpPath ID="Security"> <!-- v 1.1.0.9 --> <!-- New-Item --> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10"> <command:details> <command:name> New-Item </command:name> <maml:description> <maml:para>建立新項目。</maml:para> </maml:description> <maml:copyright> <maml:para></maml:para> </maml:copyright> <command:verb>New</command:verb> <command:noun>Item</command:noun> <dev:version></dev:version> </command:details> <maml:description> <maml:para> New-Item Cmdlet 會建立新項目並且設定項目的值。可以建立的項目類型會視項目的位置而異。例如在檔案系統中,New-Item 會用於建立檔案和資料夾。在登錄中,New-Item 會建立登錄機碼與項目。 在 Security 目錄中,您可以使用 New-Item Cmdlet 來建立及設定 Plugin 的安全性。 </maml:para> </maml:description> <!-- Cmdlet syntax section--> <command:syntax> <command:syntaxItem> <maml:name>New-Item</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>URI</maml:name> <maml:description> <maml:para> 識別依據 Sddl 參數值授權存取的 URI。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">Uri</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>SDDL</maml:name> <maml:description> <maml:para> 指定存取控制項目的安全性描述元定義語言 (SDDL)。此參數可識別 用來授權存取指定之資源 URI 的安全性設定。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ExactMatch</maml:name> <maml:description> <maml:para> 指定如何使用 Sddl 參數中指定的安全性設定。如果 ExactMatch 參數設定為 True,則只有在嘗試存取 URI 中指定的 URI 時,Sddl 中的安全性設定才會用來進行授權。 如果 ExactMatch 設定為 false,則在嘗試存取以 URI 中指定之字串開頭的 URI 時,Sddl 中的安全性設定便會 用來進行授權。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> </command:parameter> </command:syntaxItem> </command:syntax> <!-- Cmdlet parameter section --> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>URI</maml:name> <maml:description> <maml:para> 識別依據 Sddl 參數值授權存取的 URI。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">Uri</command:parameterValue> <dev:type> <maml:name>Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>SDDL</maml:name> <maml:description> <maml:para> 指定存取控制項目的安全性描述元定義語言 (SDDL)。此參數可識別 用來授權存取指定之資源 URI 的安全性設定。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">string</command:parameterValue> <dev:type> <maml:name>string</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>ExactMatch</maml:name> <maml:description> <maml:para> 指定如何使用 Sddl 參數中指定的安全性設定。如果 ExactMatch 參數設定為 True,則只有在嘗試存取 URI 中指定的 URI 時,Sddl 中的安全性設定才會用來進行授權。 如果 ExactMatch 設定為 false,則在嘗試存取以 URI 中指定之字串開頭的 URI 時,Sddl 中的安全性設定便會 用來進行授權。 </maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>confirm</maml:name> <maml:description> <maml:para>在執行命令前先提示確認。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="false" position="named"> <maml:name>WhatIf</maml:name> <maml:description> <maml:para>說明執行命令時將會發生何種情況,但不會實際執行命令。</maml:para> </maml:description> <command:parameterValue required="false" variableLength="true">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue /> </command:parameter> </command:parameters> <!-- Input - Output section--> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> 您可以經由管道將新項目的值輸出至 New-Item Cmdlet。 </maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Any</maml:name> <maml:uri /> <maml:description /> </dev:type> <maml:description> <maml:para> <!-- description --> </maml:para> </maml:description> </command:returnValue> </command:returnValues> <!-- Error section--> <command:terminatingErrors /> <command:nonTerminatingErrors /> <!-- Notes section --> <maml:alertSet> <maml:title></maml:title> <maml:alert> <maml:para> New-Item Cmdlet 設計的用意是要操作任一提供者所公開的資料。若要列出可在工作階段中使用的提供者,請輸入 "Get-PsProvider"。如需詳細資訊,請參閱 About_Providers。 </maml:para> </maml:alert> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <!-- Example section --> <command:examples> <command:example> <maml:title> -------------------------- 範例 1 -------------------------- </maml:title> <maml:introduction> <maml:para>C:\PS></maml:para> </maml:introduction> <dev:code>New-Item -path WSMan:\localhost\Plugin\TestPlugin\Resources\Resource_5967683\Security -Sddl "O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GWGX;;;WD)"</dev:code> <dev:remarks> <maml:para>這個命令會在 Resource_5967683 (特定資源) 的 Security 目錄中建立安全性項目。</maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> <maml:para></maml:para> </dev:remarks> <command:commandLines> <command:commandLine> <command:commandText></command:commandText> </command:commandLine> </command:commandLines> </command:example> </command:examples> <!-- Link section --> <maml:relatedLinks> <maml:navigationLink> <maml:linkText>Online version:</maml:linkText> <maml:uri>http://go.microsoft.com/fwlink/?LinkId=145849</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Providers</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Rename-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Move-Item</maml:linkText> <maml:uri /> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Copy-Item</maml:linkText> <maml:uri /> </maml:navigationLink> </maml:relatedLinks> </command:command> </CmdletHelpPath> </CmdletHelpPaths> </providerHelp> </helpItems>