Gpupdate Powershell Official

Some policies—like changing security settings, installing software, or modifying core system behaviors—are "locked" files. The computer can't change them while it's running. It needs a restart to apply the changes.

You need to apply the security policy and ensure the computer restarts immediately so the lock takes effect. You don't want to ask the user nicely; you need to take control. gpupdate powershell

The computer accepts the command. It applies the settings and immediately restarts the machine to lock them in. Some policies—like changing security settings