Обновление групповых политик windows 10

Чтобы на компьютере Windows применились новые настройки локальной или доменной групповой политики (GPO), служба Group Policy Client (
gpsvc
) должна перечитать настройки политик и применить изменения. Настройки групповых политик в Windows обновляются при загрузке компьютера, при входе пользователя, и автоматически в фоновом режиме (в течении от 90 до 120 минут). В некоторых случаях администратору нужно, чтобы новые настройки политики применились немедленно, не дожидаясь указанных выше событий.

Содержание:

  • Автоматическое применение настроек групповых политик в Windows
  • Принудительное обновление групповых политик на компьютере Windows
  • Обновить групповые политики на удаленных компьютерах

Автоматическое применение настроек групповых политик в Windows

Выше мы указали, когда настройки GPO автоматически применяются на клиенте:

  • Настройки групповых политик, заданные в разделе секции Computer Configuration применяются при загрузке Windows.
  • Настройки GPO из секции User Configuration применяются при входе пользователя.
  • Фоновое обновление групповых политик выполняется автоматическая раз в 90 минут + случайное смещение времени (offset) в интервале от 0 до 30 минут (рандомный интервал позволяет уменьшить нагрузку на DC одновременным запросами от клиентов). Это означает, что новые политики гарантировано применятся на клиентах в интервале 90 – 120 минут после обновления файлов GPO на контроллере домена.

    Контроллеры домена по умолчанию обновляют настройки GPO раз в 5 минут.

Настройки фонового обновления политик можно изменить с помощью параметра следующих параметров GPO в разделе Computer Configuration -> Administrative Templates -> System -> Group Policy:

  • Set Group Policy refresh interval for computers — здесь можно изменить частоту обновления настроек GPO со стандартных 90 минут и значение смещения.
  • Turn off background refresh of group policy — позволяет полностью отключить фоновое обновление настроек политик

Но в большинстве случаев трогать эти настройки не рекомендуется.

настроить частуту автоматического обновления GPO в Windows

Принудительное обновление групповых политик на компьютере Windows

Для принудительного, немедленного обновления (применения) настроек групповых политик на компьютере Windows используется утилита gpupdate.

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

Простая команда
gpudate
без параметров применяет только новые/измененные параметры GPO.

Updating policy...
Computer Policy update has completed successfully.
User Policy update has completed successfully.

gpupdate - команда обновления параметров групповых политик

Можно отдельно обновить параметры GPO из пользовательской секции

gpupdate /target:user

или только политики компьютера:

gpupdate /target:computer /force

Если некоторые политики нельзя обновить в фоновом режиме (обычно это клиентские расширения GPO, которые обрабатываются при входе пользователя), gpudate может заверишь сеанс текущего пользователя (logoff):

gpupdate /target:user /logoff

Или выполнить перезагрузку компьютера (некоторые политики, такие как установка программ в GPO, или логон скрипты применяются только при загрузке Windows):

gpupdate /Boot

Обновить групповые политики на удаленных компьютерах

Есть несколько способов для принудительного обновления настроек GPO на удаленных компьютерах Windows.

В самом простом случае вы просто можете выполнить команду gpupdate на удаленном компьютере:

  • спомощьюутилиты PSexec:
    PsExec \\PC1 gpupdate
  • через PowerShell Remoting (WinRM):
    Invoke-Command -computername PC1 -Scriptblock {gpupdate /force}

Если нужно массово обновить групповые политики на множестве компьютеров, воспользуйтесь консолью Group Policy Management Console (
GPMC.msc
).

В Windows 10 и 11 для использования консоли придется установить компонент RSAT:

Add-WindowsCapability -Online -Name Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0

Чтобы обновить политики на компьютерах, щёлкните в консоли GPMC по нужному Organizational Unit (OU) и выберите Group Policy Update.

удаленное обновление групповых политик из консоли GPMC

Консоль поочерёдно подключится к каждому компьютеру в OU, и вы получите результат со статусом обновления политик (Succeeded/Failed).

отчет по обновлению GPO на компьютерах домена

Утилита создает на компьютерах задание планировщика с командой
GPUpdate.exe /force
для каждого залогиненого пользователя. Задание запускается через случайный промежуток времени (до 10 минут) для уменьшения нагрузки на сеть.

На клиентах в файерволе Windows Defender должны быть разрешены следующие правила:

  • Remote Scheduled Tasks Management (RPC)
  • Remote Scheduled Tasks Management (RPC-ERMAP)
  • Windows Management Instrumentation (WMI-IN)

Если компьютер выключен, или доступ к нему блокируется файерволом, для него вернется ошибка ‘The remote procedure call was cancelled‘.

Также для удаленного обновления политики можно использовать PowerShell командлет Invoke-GPUpdate, который входит в модуль управления GPO. Например, для обновления политик пользователя на удаленном компьютере, выполните:

Invoke-GPUpdate -Computer PC01 -Target "User"

Вы можете задать случайную задержку обновления GPO с помощью параметра RandomDelayInMinutes. Таким образом вы можете уменьшить нагрузку на сеть, если одновременно обновляете политики на множестве компьютеров. Для немедленного применения политик используется параметр
-RandomDelayInMinutes 0
.

В сочетании с командлетом Get-ADComputer вы можете принудительно обновить настройки групповых политик на всех компьютерах (исключая неактивные) в определенном OU:

Get-ADComputer –filter {enabled -eq "true"} -Searchbase "ou=Computes,OU=SPB,dc=winitpro,dc=com" | foreach{ Invoke-GPUpdate –computer $_.name –RandomDelayInMinutes 10 -force}

При удаленном выполнении командлета Invoke-GPUpdate или обновления GPO через консоль GPMC на мониторе пользователя может на короткое время появиться черное окно консоли с запущенной командой
gpupdate
.

In Windows 10 Group Policy is a feature that controls the working environment of user accounts and computer accounts. Group Policy provides centralized management and configuration of the operating system, user’s settings, applications, in an Active Directory environment. A set or collection of Group Policies is called Group Policy Object. A Version of Group Policy is called as a Local Group Policy (LGPO). Local GPO allows managing Group Policy without Active Directory on Standalone Computers. We all know group policies are used to control what users can and cannot do on a computer system.  For example, a Group Policy can be used to enforce a password complexity policy that prevents users from choosing an overly simple password. Other examples include allowing or preventing unidentified users from remote computers to connect to a network share or to block/restrict access to certain folders. Each time you set or configure a policy you need to update the Group Policy. This article will guide you to Update Group Policy in Windows 10.

In Windows, if you want to Update Group Policy then you have to use the Windows built-in command-line tool called GPUPDATE.exe. Gpupdate command refreshes a computer Local Group Policy and any Active Directory-based Group Polices. This command is available in almost all the versions of Microsoft Operating Systems.

Syntax of Gpupdate command:

Description:  Updates multiple Group Policy settings.

Syntax:  Gpupdate [/Target:{Computer | User}] [/Force] [/Wait:]     [/Logoff] [/Boot] [/Sync]

Parameters:

/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, 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.

How to Update Local Group Policy?

Open Command Prompt in elevated mode and type the following commands.

Gpupdate

This command will force update only the changed policies.

Update Group Policy

Gpupdate /force This command will force an update or refresh all policies.

gpupdate force

After the Policy update, you will get the successful message. The computer Policy update has completed successfully. The user Policy update has completed successfully. 

Post Views: 2,454

 
Way to Manually Update Group Policy on Windows 10 with steps. – On every one hour and 30 minutes, Group Policy gets updated. In addition, it takes an extra 30 minutes randomly for refreshing. It indicates that Group policy settings become up-to-date after every 2 hours interval. So, when you open the Group Policy Editor, you might not get the refresh policy settings. But if you want to view currently updated Group policy anytime there is a way.

You will see here the way for How to manually Update Group Policy In Windows 10. Security settings determine to process the policy settings after 16 hours compulsorily if it doesn’t get an update for any reason. Moreover, the policies are processed when you restart your computer. In order to launch the same with multiple procedures, follow Open Group Policy Editor in Windows 10. So when an administrator of a local computer wants the refresh policy setting he needs to wait until the processing of the same. But when you force Update the same the policy settings will be available instantly.

Manually Update Group Policy In Windows 10

Step 1 – Open Elevated Command prompt.

When you are uncertain regarding procedures then pursue – How to Launch Elevated Command Prompt on Windows 10.

Step 2 – Copy either of the commands from below, paste into the command prompt and press the Enter key on Keyboard. Either you can type one and press Enter.

gpupdate

GPUpdate.exe

GPUpdate.exe /force

You will find a message after the successful execution of the commands – Computer Policy update has completed successfully.

The gpupdate command line allows an administrator to refresh the policy settings in the background. GPUpdate.exe performs the same works for users on Windows computer. GPUpdate.exe /force works for each signed in user.through a remote scheduled task and proceed the Policy settings forcibly to the latest update.

After you run GPUpdate.exe /force, it works within 10 minutes. The command line does not perform the task instantly due to avoiding load on Network traffic.

In earlier versions of Windows, PowerShell cmdlet Invoke-GPUpdate has been helping users to Update Group Policy Editor, but this is not working on the current edition or server 2016.

To learn about the methods for accessing the same, follow How to Run PowerShell as administrator in Windows 10.

In addition, you find few more command line tools to manage your gpedit.msc. These are GPMC, GPFIXUP, GPRESULT, GPUPDATE and LDIFDE are the tools important to perform different tasks and also fix problems.

To receive the collection of policies at the same time on your computer, come after this guide Download All Group Policy Settings in Windows 10 as Spreadsheets.

Conclusion

So these are the procedures for How to Manually Update Group Policy In Windows 10. Once you refresh the Group policy you will be able to configure your essential settings in a less amount of time.

После изменения любых настроек групповых политик с помощью локального редактора GPO (gpedit.msc) или доменного редактора политик (gpmc.msc), новые настройки политик применяются к пользователю (или компьютеру) не сразу. Вы можете дождаться автоматического обновления политик (придётся ждать до 90 минут), либо можете обновить и применить политики вручную с помощью команды GPUpdate. Команда GPUpdate используется для принудительного обновления групповых политик компьютера и/или пользователя.

Совет. В Windows 2000 для ручного обновления групповых политик использовалась команда secedit /refreshpolicy. В следующих версиях Windows она была заменена утилитой GPUpdate.

Полный синтаксис команда gpupdate выглядит так:

Gpupdate [/Target:{Computer | User}] [/Force] [/Wait:<value>] [/Logoff] [/Boot] [/Sync]

параметры утилиты gpupdate

При запуске команды gpupdate без параметров выполняется обновление только новыех и изменённых настроек политик пользователя и компьютера

gpupdate - обновить настройки групповых политик на клиенте

Updating policy…
Computer Policy update has completed successfully.
User Policy update has completed successfully.

Вы можете обновить только политики пользователя или только политики компьютера с помощью параметра /target. Например:

Gpudate /target:user

или

Gpupdate /target:computer

Для принудительного обновления настроек групповых политик используется команда GPUpdate /force. В чем разница между GPUpdate и GPUpdate /force?

Команда gpupdate применяет только измененные политики, а команда GPUpdate /force заново переприменяет все политики клиента — и новые и старые (вне зависимости от того, были ли они изменены).

В большинстве случаев для обновления политик на компьютере нужно использовать gpupdate. В больших доменах Active Directory частое использование ключа /force при обновлении GPO вызывает большую нагрузку на контроллеры домена (т.к. компьютеры запрашивают заново все нацеленные на них или на пользователей политики).

Как мы уже говорили ранее групповые политики обновляются автоматически каждые 90 минут или во время загрузки компьютера. Поэтому в большинстве случае использование опции gpupdate /force не оправдано (особенно в различных скриптах) из-за высокой нагрузки на клиентские компьютеры, контроллеры домена и каналы передачи данных. Не стоит часто использовать параметр /force для принудительного обновления натсроек политик у клиентов, подключенных по медленным и нестабильным каналам передачи.

Вы можете добавить задержку (до 600 секунд) при обновлении политик с помощью параметра /wait:

Gpupdate /wait:30

Т.к. некоторые политики пользователя нельзя обновить в фоновом режиме, а только при входе пользователя в систему (установка программ, перенаправление папок и т.д.), вы можете выполнить logoff для текущего пользователя командой:

gpupdate /logoff
Некоторые настройки политик компьютера могут применится только при загрузке Windows, поэтому вы можете инициировать перезагрузку компьютера с помощью параметра /Boot:

gpupdate /Boot
Параметр /Sync указывает, что следующее применение политики должно выполняться синхронно. Активные применения политики происходят при перезагрузке компьютера или при входе пользователя в систему.

В PowerShell 3.0 был добавлен командлет Invoke-GPUpdate, который можно использовать для обновления политик на удаленных компьютерах. Например, следующая команда запустит удаленное обновление групповых политик на компьютере msk-PC-1-22:

Invoke-GPUpdate -Computer msk-PC-1-22 -Force

Вы можете удаленно запустить принудительное обновление политик на всех компьютерах в указанном OU Active Directory с помощью команд:

$Comps = Get-AdComputer -SearchBase "OU=Computers,OU=MSK,DC=vmblog,DC=ru" -Filter *
Foreach ($Comp in $Comps) {invoke-gpupdate -Computer $Comp.Name}

In this guide, you will learn how to use the gpupdate command to immediately apply new group policy settings to users and computers.

I’ll also explain the difference between the gpupdate and gpupdate /force command.

Contents

  • What is gpupdate
  • How to use the gpupdate command
  • GPUpdate vs GPUpdate /force
  • Run gpupdate on remote computer
  • GPUpdate examples

What is the gpupdate command

The gpupdate command is a tool built into the Windows operating system and is used to update or apply new group policy settings. The gpupdate command is often used by Windows technicians to ensure group policy settings are applied to a computer.

What are group policy settings?

Group policy settings are configurations such as password settings, lockout policy, screen lockout, restrict system changes and so on. These settings are configured in Active Directory and can be applied to specific or all users and computers.

In a Windows domain, the group policy settings automatically refresh every 90 minutes or when the computer is rebooted. There are times when you need to immediately update a computer’s policies and waiting 90 minutes is not an option. With the gpupdate command you can immediately refresh the group policy settings without a reboot.

How to use the gpupdate command

The gpupdate command is very easy to use.

There are several command line switches available with the gpupdate command, to view all the options use this command.

gpupdate /?

Key Parameters

  • /target:user: Specifies that only user policies are updated.
  • /target:computer: Specifies that only computer policies are updated.
  • /force: Reapplies all policy settings. By default, only policy settings that have changed are
    applied.

To update the group policies, follow the steps below.

Step 1. Start windows PowerShell

Step 2. Type gpupdate and press enter

gpupdate command

Step 3. Wait for the command to complete

When the gpupdate command is complete it should say completed successfully for both user and computer policies.

gpupdate completed

To update only the user policy settings run this command.

gpupdate /target:user

To update only the computer policy settings run this command.

gpupdate /target:computer

What is the difference between gpupdate and gpupdate /force command?

  • GPUpdate – This command performs an increment update. This means it only applies policies that have changed or new settings since the last update. For example, you update the GPO policy that enabled the Windows lock screen. This command will only apply that one policy that changed.
  • GPUpdate /force – This command forces all group policies to be reapplied to the computer. If you have 20 group policies, then all 20 will get reapplied.

Here is a table showing the difference between gpupdate and gpupdate /force.

Feature gpupdate gpupdate /force
Purpose Updates only policy settings that have changed. Reapplies all policy settings.
When to Use Refresh existing GPO policies or apply new GPOs. Troubleshooting or to download and reapply ALL GPOs.
Impact Low – minimal impact as only changes are applied. High – Can be high if running on multiple computers at the same time.
Use Case You need to immediately apply a new GPO setting such as locking down the control panel or password settings. The gpupdate command is not applying new GPO changes.

So which command should you use?

It’s best to start with the GPUpdate command, this should work most of the time. If the gpupdate command didn’t work, then try gpupdate /force.

I would not run gpupdate /force on several devices at one time. If you have a lot of group policies this can be resource intensive on domain controllers.

With that said I’ve not seen any issues running gpupdate /force as the first option. I’ve also seen no reason to run it as the first option. Most of the time I’m able to run gpupdate and everything works. As I mentioned above the main concern with gpupdate /force is running it on multiple computers at once, this could put a major load on your domain controllers.

I often see helpdesk technicians run gpupdate /force as the first option, and again I see no issues with this on a one to one basis.

How to use the gpupdate force command

Only use the gpupdate /force command if you want to reapply all group policy settings.

Step 1. Start windows PowerShell

Step 2. Type gpupdate force and press enter

Step 3. Wait for command to complete

gpupdate /force command

Run gpupdate on a remote computer

There are multiple ways to run gpupdate on remote computers.

Option 1. PowerShell

If you have PowerShell remoting enabled, you can run gpupdate using the command below.

Invoke-Command -ComputerName RemoteComputerName -ScriptBlock { gpupdate }

In this example, I’m updating the policies on the remote computer pc2.

gpupdate remote computer

To update on multiple remote computers using PowerShell use this command. The below command will update all computers in my Accounting OU. Just change the search base path to the distinguishedName of your OU.

PS C:\> $computers = Get-ADComputer -Filter * -SearchBase "OU=Accounting,OU=ADPRO Computers,DC=ad,DC=activedirectorypro,DC=com"
PS C:\> $computers | ForEach-Object -Process {Invoke-GPUpdate -Computer $_.name -RandomDelayInMinutes 0 -Force}

Option 2. Group Policy Management Console

You can force a group policy update on all computers using the group policy management console.

Step 1. Open the Group Policy Management Console

Step 2. Right click an OU and select “Group Policy Update”

This will force an update on all the computers in the selected OU.

gpupdate group policy console

force gpo update

GPUpdate Examples

Here are some real-world examples of using the gpupdate command.

Example 1: Add shortcut to users desktop

A user puts in a high priority ticket and says I need the timesheet program installed on my computer ASAP. In this example, the user just needs a desktop shortcut added to the desktop. Ok, no problem.

You go into the group policy management console and apply the GPO to the user. You then remote to the user’s computer and run the gpupdate command.

Here is a before picture.

gpupdate example

After running gpupdate you can see the desktop shortcut added to the desktop.

added icon to desktop

The group policy immediately applies, and the shortcut is added to the desktop. A reboot would also refresh the group policies but sometimes that is inconvenient for your users.

The nice thing about the gpupdate command is it can be run as a user with non admin rights. In the example above you can see I ran the command with the user logged in. Depending on the GPO settings this may not always work. In some cases, you may need to reboot a computer for settings to apply.

Example 2: Your Boss requests for software to be installed

In this example, your boss needs Acrobat Pro installed right away. Sure thing boss. Open the group policy management console and add the user to the GPO that installs Acrobat Pro.

Next, issue the gpupdate command. But this time you get the message below.

gpupdate software install

I wanted to show this example because not all policies can be applied immediately. Deploying software through group policy can only occur during a restart.

Sorry, boss you need to reboot. 🙂

Related Articles

  • GPResult command
  • RSoP command
  • Group Policy Management Guide
  • Invoke-GPUpdate

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows 10 legacy boot menu
  • Appinstaller чем открыть приложение в windows 10
  • Команды для сканирования системы на ошибки windows 10
  • Как зайти в восстановление системы windows 10 без флешки
  • Развернуть ftp сервер windows server 2016