Modification to actionRefreshGPO

Jun 20, 2013 at 1:07 PM
Our team has found that if we remove the GroupPolicy folders before refreshing GP, our results are better. With that in mind, I added these lines just above the actual refresh:
' Delete Group Policy folders
strCommand = "cmd.exe /C echo n | rmdir /s /q c:\windows\system32\GroupPolicy*"
errReturn = objWMIProcess.Create(strElevate & strCommand,null,objConfig,intProcessID)

If errReturn <> 0 Then
    statFailed = statFailed + 1
  Log " !! Failed to remove Group Policy folders on " & UCase(remoteComputer) & "! Error "&errReturn&".", True, "refreshGPO", 3
  Exit Function
End If