gpupdate

更新组策略设置。

Syntax

gpupdate [/target:{computer | user}] [/force] [/wait:<VALUE>] [/logoff] [/boot] [/sync] [/?]

Parameters

Parameter Description
/target:{computer|user} 指定仅更新用户或仅计算机策略设置。 默认情况下,用户和计算机策略设置都已更新。
/force 重新应用所有策略设置。 默认情况下,仅应用已更改的策略设置。
/wait:<VALUE> 设置等待策略处理完成的秒数,然后再返回到命令提示符。 超过时间限制时,会显示命令提示符,但策略处理仍在继续。 默认值为 600 秒。 The value 0 means not to wait. The value -1 means to wait indefinitely.

In a script, by using this command with a time limit specified, you can run gpupdate and continue with commands that do not depend upon the completion of gpupdate. Alternatively, you can use this command with no time limit specified to let gpupdate finish running before other commands that depend on it are run.

/logoff 在更新组策略设置后导致注销。 对于那些在后台更新周期上不处理策略,但在用户登录时执行进程策略的组策略客户端扩展是必需的。 示例包括用户目标软件安装和文件夹重定向。 如果没有调用需要注销的扩展,则此选项不起作用。
/boot 应用组策略设置后,导致计算机重启。 对于那些在后台更新周期上不处理策略,但在计算机启动时处理策略的组策略客户端扩展是必需的。 示例包括计算机目标软件安装。 如果没有调用需要重启的扩展,则此选项不起作用。
/sync 导致下一个前台策略应用程序同步完成。 前台策略在计算机启动和用户登录时应用。 You can specify this for the user, computer, or both, by using the /target parameter. The /force and /wait parameters are ignored if you specify them.
/? 在命令提示符处显示帮助。

Examples

若要强制对所有组策略设置进行后台更新,请键入:

gpupdate /force