gpupdate
秃噜豆儿 发表于 2020-06-23 11:33浏览次数:
该运行命令刷新计算机的本地组策略,以及任何基于Active Directory组策略。
The gpupdate command refreshes a computer's local Group Policy, as well as any Active Directory-based group policies.
目录:
1 gpupdate 运行系统环境
2 gpupdate 语法
3 gpupdate 示例
gpupdate 运行系统环境
Windows xp
Windows vista
Windows 7
Windows 8
Windows 10
gpupdate 语法
GPUpdate [/Target:{Computer | User}] [/Force] [/Wait:] [/Logoff] [/Boot] [/Sync]
/Target:{Computer | User}
|
指定仅刷新用户或仅刷新计算机策略设置。默认情况下,用户和计算机策略设置均被刷新。
|
/Force
|
重新应用所有策略设置。默认情况下,仅应用已更改的策略设置。
|
/Wait:{value}
|
设置等待策略处理完成的秒数。默认值为600秒。值“ 0”表示不等待。值“ -1”表示无限期等待。
当超过时间限制时,命令提示符将返回,但是策略处理将继续。
|
/Logoff
|
刷新组策略设置后导致注销,这对于那些在后台刷新周期中不处理策略但在登录期间执行的客户端扩展是必需的。
示例包括针对用户的软件安装和文件夹重定向。如果没有调用需要注销的扩展名,则此选项无效。
|
/Boot
|
刷新组策略设置后导致重新启动,这对于那些在后台刷新周期中不处理策略但在启动时执行的客户端扩展是必需的。
示例包括以计算机为目标的软件安装。如果没有称为需要重新引导的扩展名,则此选项无效。
|
/Sync
|
使下一个前台策略应用程序同步完成。前景策略应用程序在计算机启动和用户登录时发生。
您可以使用/ Target参数为用户,计算机或两者指定此选项。如果指定了/ Force和/ Wait参数,则将其忽略。
|
GPUpdate [/Target:{Computer | User}] [/Force] [/Wait:] [/Logoff] [/Boot] [/Sync]
/Target:{Computer | User}
|
Specifies that only user or only computer policy settings be refreshed. By default, both user and computer policy settings are refreshed.
|
/Force
|
Reapplies all policy settings. By default, only policy settings that have changed are applied.
|
/Wait:{value}
|
Sets the number of seconds to wait for policy processing to finish. The default is 600 seconds. The value '0' means not to wait.
The value '-1' means to wait indefinitely. When the time limit is exceeded, the command prompt returns, but policy processing continues.
|
/Logoff
|
Causes a logoff after the Group Policy settings are refreshed, which is required for those client-side extensions
that don't process policy on a background refresh cycle but do during log on.
Examples include user-targeted Software Installation and Folder Redirection. This option has no effect if there are no extensions called that require a logoff.
|
/Boot
|
Causes a reboot after the Group Policy settings are refreshed, which is required for those client-side extensions
that don't process policy on a background refresh cycle but do at startup.
Examples include computer-targeted Software Installation. This option has no effect if there are no extensions called that require a reboot.
|
/Sync
|
Causes the next foreground policy application to be done synchronously. Foreground policy applications occur at computer boot and user login.
You can specify this for the user, computer or both using the /Target parameter. The /Force and /Wait parameters are ignored if specified.
|
gpupdate 示例
gpupdate
单独运行该命令将刷新计算机策略,如示例输出中所示。
Refreshing Policy.
User Policy Refresh has completed.
Computer Policy Refresh has completed.
gpupdate
Running the command alone refreshes the computers policies as shown below in the example output.
Refreshing Policy.
User Policy Refresh has completed.
Computer Policy Refresh has completed.