Способы обновления групповых политик Windows на компьютерах домена
15.11.2022
itpro
Active Directory, PowerShell, Windows 10, Windows Server 2016, Групповые политики
комментариев 12
В этой статье мы рассмотрим особенности обновления параметров групповых политик на компьютерах домена Active Directory: автоматическое обновление политик, команду GPUpdate , удаленное обновление через консоль Group Policy Management Console ( GPMC.msc ) и командлет PowerShell Invoke-GPUpdate .
Интервал обновления параметров групповых политик
Чтобы новые настройки, которые вы задали в локальной или доменной групповой политике (GPO) применились на клиентах, необходимо, чтобы служба Group Policy Client перечитала политики и внесла изменения в настройки клиента. Это процесс называется обновление групповых политик. Настройки групповых политик обновляются при загрузке компьютере и входе пользователя, или автоматически в фоновом режиме раз в 90 минут + случайное смещение времени (offset) в интервале от 0 до 30 минут (т.е. политики гарантировано применятся на клиентах в интервале 90 – 120 минут после обновления файлов GPO на контроллере домена).
Вы можете изменить интервал обновления настрое GPO с помощью параметра Set Group Policy refresh interval for computers, который находится в секции GPO Computer Configuration -> Administrative Templates -> System -> Group Policy.
Включите политику (Enabled) и задайте время (в минутах) в следующих настройках:
- This setting allow you to customize how often Group Policy is applied to computer (от 0 до 44640 минут) – как часто клиент должен обновлять настройка GPO (если указать тут 0 – политики начнут обновляться каждые 7 секунд – не стоит этого делать);
- This is a random time added to the refresh interval to prevent all clients from requesting Group Policy at the same time (от 0 до 1440 минут) – максимальное значение случайного интервал времени, которые добавляется в виде смещения к предыдущему параметру (используется для уменьшения количества одновременных обращений к DC за файлами GPO от клиентов).

GPUpdate.exe – команда обновления параметров групповых политики
Всем администраторов знакома команда gpupdate.exe, которая позволяет обновить параметры групповых политик на компьютере. Большинство не задумываясь используют для обновления GPO команду gpupdate /force . Эта команда заставляет компьютер принудительно перечитать все политики с контроллера домена и заново применить все параметры. Т.е. при использовании ключа force клиент обращается к контроллеру домена и заново получает файлы ВСЕХ нацеленных на него политик. Это вызывает повышенную нагрузку на сеть и контроллер домена.
Простая команда gpudate применяет только новые/измененные параметры GPO.
Если все OK, должны появится следующие строки:

Можно отдельно обновить параметры GPO из пользовательской секции:
или только политики компьютера:
gpupdate /target:computer /force
Если некоторые политики нельзя обновить в фоновом режиме, gpudate может выполнить logoff текущего пользователя:
gpupdate /target:user /logoff
Или выполнить перезагрузку компьютера (если изменения в GPO могут применится только во время загрузки Windows):
Принудительно обновление политики из консоли Group Policy Management Console (GPMC)
В консоли GPMC.msc (Group Policy Management Console), начиная с Windows Server 2012, появилась возможность удаленного обновления настроек групповых политик на компьютерах домена.
Add-WindowsCapability -Online -Name Rsat.GroupPolicy.Management.Tools
Теперь после изменения настроек или создания и прилинковки новой GPO, вам достаточно щелкнуть правой клавишей по нужному Organizational Unit (OU) в консоли GPMC и выбрать в контекстном меню пункт Group Policy Update. В новом окне появится количество компьютеров, на которых будет выполнено обновление GPO. Подтвердите принудительное обновление политик, нажав Yes.

Затем GPO по очереди обновяться на каждом компьютере в OU и вы получите результат со статусом обновления политик на компьютерах (Succeeded/Failed).
Данная команда удаленно создает на компьютерах задание планировщика с командой GPUpdate.exe /force для каждого залогиненого пользователя. Задание запускается через случайный промежуток времени (до 10 минут) для уменьшения нагрузки на сеть.
- Открыт порт TCP 135 в Windows Firewall;
- Включены службы Windows Management Instrumentation и Task Scheduler.
Если компьютер выключен, или доступ к нему блокируется файерволом напротив имени такого компьютера появится надпись “The remote procedure call was cancelled”.
По сути этот функционал дает тот же эффект, если бы вы вручную обновили настройки политик на каждом компьютере командой GPUpdate /force .

Invoke-GPUpdate – обновление GPO из Powershell
Также вы можете вызвать удаленное обновление групповых политик на компьютерах с помощью PowerShell комнадлета Invoke-GPUpdate (входит в RSAT). Например, чтобы удаленно обновить пользовательские политики на определенном компьютере, можно использовать команду:
Invoke-GPUpdate -Computer «corp\Computer0200» -Target «User»
При запуске командлета Invoke-GPUpdate без параметров, он обновляет настройки GPO на текущем компьютере (аналог gpudate.exe).
В сочетании с командлетом Get-ADComputer вы можете обновить групповые политики на всех компьютерах в определенном OU:
Get-ADComputer –filter * -Searchbase «ou=Computes,OU=SPB,dc=winitpro,dc=com» | foreach
или на всех компьютерах, которые попадают под определенный критерий (например, на всех Windows Server в домене):

При удаленном выполнении командлета Invoke-GPUpdate или обновления GPO через консоль GPMC на мониторе пользователя может на короткое время появиться окно консоли с запущенной командой gpupdate .
Предыдущая статья Следующая статья
Updating Group Policy Settings on Windows Domain Computers
In this article we will show how to update Group Policy (GPO) settings on Windows computers in an Active Directory domain: how to update (refresh) Group Policies automatically, how to use the GPUpdate command, how to update them remotely using the Group Policy Management Console ( GPMC.msc ) or the Invoke-GPUpdate PowerShell cmdlet.
How to Change Group Policy Refresh Interval?
Prior to the new settings you have set in a local or domain Group Policy (GPO) are applied to Windows clients, the Group Policy Client service must read the policies and make changes to the Windows settings. The process is called a Group Policy Update. GPO settings are updated when the computer boots, the user logs on, and refreshed automatically in the background every 90 minutes + a random time offset of 0–30 minutes (it means that the policy settings will definitely be applied on the clients in 90–120 minutes after you have updated GPO files on the domain controller).
You can change the GPO update interval using the Set Group Policy refresh interval for computers option located in Computer Configuration -> Administrative Templates -> System -> Group Policy section of the GPO.
Enable the policy and set the time (in minutes) for the following options:
- This setting allows you to customize how often Group Policy is applied to computers (0 to 44640 minutes) how often the client should refresh the GPO settings in the background. If you set 0 here, the policies will be updated every 7 seconds (it is not worth to do it);
- This is a random time added to the refresh interval to prevent all clients from requesting Group Policy at the same time (0 to 1440 minutes) is a maximum value of a random time interval added as an offset to the previous parameter (used to reduce the number of simultaneous client calls to the DC to download GPO files).

Using GPUpdate.exe Command to Force Refresh GPO Settings
All administrators know the gpupdate.exe command that allows to update Group Policy settings on a computer. To do it, most use the gpupdate /force command without any hesitation. The command forces your computer to read all GPOs from the domain controller and reapply all settings. This means that when the force key is used, the client connects to the domain controller to retrieve the files for ALL policies targeting it. It may result in higher load on your network and domain controller.
A simple gpudate command without any parameters only applies new and changed GPO settings.
If it has been successful, the following message appears:

You can update only user’s GPO settings:
or only the computer’s policy settings:
gpupdate /target:computer /force
If some policies cannot be updated in the background, gpupdate can log off the current user:
gpupdate /target:user /logoff
Or restart a computer (if the GPO changes can only be applied when Windows boots):
How to Force a Remote GPO Update from the Group Policy Management Console (GPMC)?
In Windows Server 2012 and newer, you can update Group Policy settings on domain computers remotely using the GPMC.msc (Group Policy Management Console).
Add-WindowsCapability -Online -Name Rsat.GroupPolicy.Management.Tools
Then after changing any settings, or creating and linking a new GPO, it is enough to right-click the Organizational Unit (OU) you want in the GPMC and select Group Policy Update in the context menu. In a new window, you will see the number of computers GPO will be updated on. Confirm the force update of the policies by clicking Yes.

Then the GPO will be remotely updated on each computer in the OU one by one, and you will get the result with the group policy update status on the computers (Succeeded/Failed).
This feature creates a task in the Task Scheduler with the GPUpdate.exe /force command for each logged on user on the remote computer. The task runs in a random period of time (up to 10 minutes) to reduce the network load.
- TCP Port 135 must be open in Windows Defender Firewall rules;
- Windows Management Instrumentation and Task Scheduler services must be enabled.
If a computer is turned off or a firewall blocks access to it, the ‘ The remote procedure call was canceled. Error Code 8007071a ’ message appears next to the name of the computer.
Actually, the feature works the same as if you have updated GPO settings manually using the GPUpdate /force command on each computer.

Invoke-GPUpdate: Force Remote Group Policy Update via PowerShell
You can also call the remote GPO update on computers using the Invoke-GPUpdate PowerShell cmdlet (being a part of RSAT Group Policy management module). For example, to remotely update user policy settings on a specific computer, you can use the following command:
Invoke-GPUpdate -Computer «frparsrv12» -Target «User»
If you run the Invoke-GPUpdate cmdlet without any parameters, it will update the GPO settings on the current computer (like gpudate.exe).
Together with the Get-ADComputer cmdlet, you can update GPO on all computers in a specific OU:
Get-ADComputer –filter * -Searchbase «OU=Computes,OU=Mun,OU=DE,dc=woshub,dc=com» | foreach
or on all computers meeting the specific requirement (for example, on all Windows Server hosts in a domain):

If you run the Invoke-GPUpdate cmdlet remotely or update GPO from the GPMC, a console window with the running gpupdate command may appear on a user desktop for a short time.
How to use GPUpdate /Force Command to update your Group Policies
The command gpupdate /force is used to force the update of group policies that are applied by your company. Changes made in the Group Policy are not applied immediately but after 90 mins by default (with a
30 min offset to spread the load). By using the GPUpdate command we can force the update.
Group Policies are used to change security settings and for system management (like deploying printers or mapping network drives). For troubleshooting IT problems, it’s sometimes necessary to update the group policy manually.
How force group policy update
-
Press Windows key + X or right-click on the start menu

Wait for the Computer and User policy to update

A reboot is necessary to be sure that all settings are applied.
GPUpdate vs GPUpdate Force command
The gpupdate /force command is probably the most used group policy update command. When you use the /force switch, all the policy settings are reapplied. For most use cases this is perfectly fine, but keep in mind, when you have a lot of group policies objects (GPO) or in a large environment, using the /force will put a huge load on the domain controllers.
If you have a large tenant or a lot of GPO’s, then it’s better to only run gpupdate without the /force switch to apply new policy settings. This will get only the changes or new group policies, reducing the load on the client and domain controllers.
Update only user or computer group policies
If you have a large environment or need to update the group policies on a lot of computers at the same time, then it can be useful to only update what is needed. This will reduce the load on the domain controllers and it’s of course faster.
To do this you can use the /target switch. This allows you to update only the user or computer GPO’s.
Automatically reboot or logoff after GPUpdate
Not all policy changes are applied immidiately. Due to Fast Boot, for example, are some settings only applied when the users logs in on the computer. Some settings even require a reboot to be applied.
With the use of the /logoff or /boot switch, we can let gpupdate figure out if a logoff or reboot is necessary. To be clear, if you run gpupdate /boot, then the computer will only reboot if a policy change requires it. Otherwise, the policy will be applied immediately without the reboot.
- GPUpdate /logoff is needed for example after policy changes in the Active Directory like folder redirections or printers. Changes in the AD are only applied when the user logs in on the computer.
- GPUpdate /boot is for example needed when you create Software Distribution changes.
Run GPUpdate on a Remote Computer
Sometimes you may need to update quickly the group policies on multiple computers because you changed the internet proxy settings or maybe to replace a printer for example. There are couple of ways to run GPUpdate on a remote computer
Using the Group Policy Management Console
You can initiate a group policy update on a whole OU with the Group Policy Management Console. It has to be an OU with only computer objects in it, so you can’t use the method on a user OU. Simply right-click on the OU where you have changed a policy and click on Group Policy Update

This will update the user and computer policies on all the computers in the given organization unit. The nice thing is that it will as for confirmation and show you how many computers are going to be updated.

After you have confirmed the update the policies will be updated and you can see the status of each computer. In this example 5 computers where turned off, so the update failed.
Use PowerShell to run GPUpdate on a Remote Computer
We can also use PowerShell to run gpupdate on remote computers. The only requirement is that you have Windows 2012 or later. Running it from Windows 10 is also possible, but then you need to open the PowerShell windows with a domain admin account.
The basis of the command is the Invoke-GPUpdate cmd. We also need to specify the computer and the RansomDelayInMinutes.
The RandomDelayInMinutes is used to lower the network load when you update a lot of computers at the same time. You can set it between 0 and 44640 minutes (31 days). Use 0 to run the update immediately.
If a user is logged on at the computer, then the Invoke-GPupdate command will ask the user for confirmation. By using the -force switch we can run the updates without the confirmation.
With this, we can create a small script to target all computers in a specific OU and run GPupdate on them.
Or if you want to use a list of computers:
Wrapping Up
I hope this article helped you with the GPUpdate /force command. If you have any questions, then just drop a comment below.
Команда GPUPDATE: обновление групповых политик Windows
Команда GPUPDATE используется для обновления групповых политик пользователя и/или компьютера в операционных системах Windows.
Синтаксис команды gpupdate выглядит следующим образом:
GPUPDATE [/Target:
Команда имеет следующие параметры:
/Target: — обновление параметров политики только пользователя ( User ) или только компьютера ( Computer ). Если не указано, обновляются параметры обеих политик;
/Force — применение всех параметров политики. Если не указано, применяются только изменившиеся параметры политики;
/Wait:значение — время ожидания (в секундах) завершения обработки политики. По умолчанию — ожидание 600 секунд. Значение ‘0’ — без ожидания. Значение ‘-1’ — ожидание не ограничено. В случае превышения времени ожидания вновь активизируется окно командной строки, но обработка политики продолжается;
/Logoff — выполнение выхода после обновления параметров групповой политики. Требуется для тех клиентских расширений групповой политики, которые не обрабатывают политику в фоновом режиме, а обрабатывают ее только при входе пользователя, таких, например, как установка программ для пользователя или перенаправление папок. Этот параметр не оказывает влияния, если не вызываются расширения, требующие выхода пользователя;
/Boot — выполнение перезагрузки после применения параметров групповой политики. Требуется для тех клиентских расширений групповой политики, которые не обрабатывают политику в фоновом режиме, а обрабатывают ее только при запуске, таких, например, как установка программ для компьютера. Этот параметр не оказывает влияния, если не вызываются расширения, требующие перезапуска системы;
/Sync — следующее активное применение политики должно выполняться синхронно. Активные применения политики происходят при перезагрузке компьютера или при входе пользователя в систему. Можно использовать этот параметр для пользователя, компьютера или для обоих, задав параметр /Target . При этом параметры /Force и /Wait , если они указаны, пропускаются.
Примеры использования команды gpupdate :
Обновить групповые политики компьютера и пользователя с применением только изменившихся политик: