共用方式為


gpresult

顯示遠端使用者和電腦的原則結果組 (RSoP) 資訊。 若要透過防火牆針對遠端目標電腦使用 RSoP 報告,您必須具備在連接埠上啟用輸入網路流量的防火牆規則。

Syntax

gpresult [/s <system> [/u <username> [/p [<password>]]]] [/user [<targetdomain>\]<targetuser>] [/scope {user | computer}] {/r | /v | /z | [/x | /h] <filename> [/f] | /?}

Note

Except when using /?, you must include an output option, /r, /v, /z, /x, or /h.

Parameters

Parameter Description
/秒 <system> 指定遠端電腦的名稱或 IP 位址。 請勿使用反斜線。 預設是本機電腦。
/u <username> 使用指定的使用者認證來執行命令。 預設使用者為已登入發出命令之電腦的使用者。
/p [<password>] Specifies the password of the user account that is provided in the /u parameter. If /p is omitted, gpresult prompts for the password. The /p parameter can't be used with /x or /h.
/使用者 [<targetdomain>\]<targetuser>] 指定要顯示其 RSoP 資料的遠端使用者。
/範圍 {user | computer} 顯示使用者或電腦的 RSoP 資料。 If /scope is omitted, gpresult displays RSoP data for both the user and the computer.
[/x | /h] <filename> Saves the report in either XML (/x) or HTML (/h) format at the location and with the file name that is specified by the filename parameter. Can't be used with /u, /p, /r, /v, or /z.
/f Forces gpresult to overwrite the file name that is specified in the /x or /h option.
/r 顯示 RSoP 摘要資料。
/v 顯示詳細資訊原則資訊。 這會包括以優先順序 1 套用的詳細設定。
/z 顯示與群組原則相關的所有可用資訊。 這會包括以優先順序 1 以上套用的詳細設定。
/? 在命令提示字元顯示說明。

Remarks

  • 群組原則為定義和控制組織內適用於使用者及電腦之程式、網路資源與作業系統的主要系統管理工具。 在 Active Directory 環境中,群組原則會根據使用者或電腦在網站、網域或組織單位中的成員資格來對其套用。

  • 由於您可以對任何電腦或使用者套用重疊的原則設定,群組原則功能會在使用者登入時產生一組隨之產生的原則設定。 The gpresult command displays the resulting set of policy settings that were enforced on the computer for the specified user when the user signed in.

  • Because /v and /z produce much information, it's useful to redirect output to a text file (for example, gpresult/z >policy.txt).

  • 在 ARM64 版本的 Windows 上,只有 SysWow64 中的 gpresult 能與 /h 參數搭配運作。

Examples

To retrieve RSoP data for only the remote user maindom\targetuser, on the computer srvmain, enter:

gpresult /s srvmain /user maindom\targetuser /scope user /r

To save all available information about Group Policy to a file named policy.txt for only the remote user maindom\targetuser, on the computer srvmain, enter:

gpresult /s srvmain /user maindom\targetuser /z > policy.txt

To display RSoP data for the signed-in user, maindom\hiropln with the password p@ssW23, for the computer srvmain, enter:

gpresult /s srvmain /u maindom\hiropln /p p@ssW23 /r