Check if Group Policy is Out of Date with PowerShell
This PowerShell script will check the registry for the last time the Group Policy ran, calculate the current date and compare to a set value (30 Days). It will the result is greater than the set value it will return $true or $false.