Patching policy cannot be applied due to "Failed to execute script LGPEdit.exe"
In some cases the Local Group Policy settings on a system become broken and the Onsite Manager/Device Manager is not able to insert the local policy to apply patching settings.
In C:\Program Files (x86)\Level Platforms\Onsite Manager\Logs\traceexpertsystem.txt there will be an error similar to
2020/06/18 12:00:00 [35] ERROR Avg.MW.OM.MWExpertSystem.Business.OMExpertSystem.PatchAgent - Failed to execute script LGPEdit.exe on device with IP(s) 192.168.1.1. Return Code: -532462766. Task Error: AUTOMATIONTASK_ERROR_SUCCESS Std Error: Unhandled Exception: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component. at LocalPolicy.COM.IGroupPolicyObject.OpenLocalMachineGPO(UInt32 flags) at LocalPolicy.ComputerGroupPolicyObject.<>c__DisplayClass2.<.ctor>b__0() at LocalPolicy.GroupPolicyObject.trycatch(Func`1 operation, String messageTemplate, Object[] messageArgs) at LocalPolicy.ComputerGroupPolicyObject..ctor(GroupPolicyObjectSettings options) at LGPEdit.PatchPolicyConfigurator.SetPolicy(String configFile) at LGPEdit.Program.Main(String[] args) Std Out: 2018/06/14 14:25:59 [35] INFO Avg.MW.OM.MWExpertSystem.Business.OMExpertSystem.PatchAgent - Update Patch Agent - DEVICE ASYNC End - DeviceID: 1
To repair this log into the device that is mentioned in the log entry by IP address and follow these steps:
- Delete that file C:\Windows\System32\GroupPolicy\Machine\Registry.pol from the endpoint device.
- Make a change to the patch policy and wait few minutes.
- Run the WSUSClientDiagnostic tool on the device to verify that settings were created.