![]() LastWriteTime "), deleting and forcing a GPUpdate " –ForegroundColor Magenta Write-Host " $computer Registry.pol file is old ( " $regpol. LastWriteTime -lt ( get-date).AddDays( -1)) $regpol = Get-Childitem \\ $computer\c$\Windows\System32\GroupPolicy\Machine\Registry.pol If ( Test-Path –Path \\ $computer\c$\Windows\System32\GroupPolicy\Machine\Registry.pol –ErrorAction Silentl圜ontinue –WarningAction Silentl圜ontinue) ![]() If ( Test-NetConnection –ComputerName $computer –Hops 1 –InformationLevel Quiet –ErrorAction Silentl圜ontinue –WarningAction Silentl圜ontinue) One of the caveats to this process was while there a many more cmdlets in Powershell V3 that I could leverage, it still had to support Windows 7 machines at the time of writing and therefore leverage much less cleaner ways to kick of a Group Policy refresh. ![]() ![]() Check the Date Modified tag of the file and if older than 1 day (good sign of corruption), delete the file and force a Group Policy refresh.Confirms that it has permissions to the location of Registry.pol.Confirms they are reachable over the network.So in a effort to be able to clean up such a corruption at scale, I created a Powershell script that: This file contains all the machine-based Group Policy settings in Registry format and are loaded at Operating System startup.įor reasons not even known by Microsoft it seems, this file can occasionally get corrupt and centrally defined Group Policies are no longer updated/kept in sync. One ongoing issue that can occur across an predominately Windows/Group Policy heavy enterprise environment is the corruption of the Registry.pol file located in %windir%\system32\Group Policy\Machine\.
0 Comments
Leave a Reply. |