Running GPUpdate during ConfigMgr OSD

I’ve seen a lot of people wanting to do a GPUpdate when a task sequence has finished and before the computer reboots so that it will have a certain policy or setting in place the first time the machine boots.
This is what I do in my task sequence to achieve this result.

Step 1
Open your task sequence and create a New Group. Name your group whatever you like and give it a description. I called mine Enable Group Policy.

Step 2
Add 4 Run Command Line steps to your task sequence under your new group. Name the first one and give it a description. Paste the following line in the command line section.

cmd /c reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{827D319E-6EAC-11D2-A4EA-00C04F79F83A}” /v MaxNoGPOListChangesInterval /t REG_DWORD /d 960 /f

Step 3
Go to your next command line step give it a name, a description, and paste the following in the command section.

powershell.exe -executionpolicy bypass -command “stop-service gpsvc -force”

Step 4
Go to your next command line step give it a name, a description, and paste the following in the command section.

powershell.exe -executionpolicy bypass -command “start-service gpsvc”

Step 5
Go to your last command line step give it a name, a description, and paste the following in the command section.

gpupdate /force

Your gpupdate will now run and your policies will be ready on the next reboot!

Too much trouble? Just want GPUpdate to run on the next reboot? Ok then. Just add a Run Command Line and the end of your task sequence before any reboot command and paste the following.

c:\windows\system32\reg.exe add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runonce” /v GPupdate /d “C:\windows\system32\gpupdate.exe” /f

On the next reboot the Gpupdate will occur.

 

About The Author

I have worked in the computer repair field since the early '90s. I was a technician and then Coordinator of Computer Repair for Regional Education Service Agency II (RESA 2) for 18 years. I am currently working for Wayne County Schools as a Network Engineer/Technology Specialist. I am responsible for the schools' Internet access, Wi-Fi, networks, servers, laptops, desktops, and operating systems and software.

Related posts

Leave a Reply

Your email address will not be published. Required fields are marked *

fifty nine − 49 =