Skip to content

Instantly share code, notes, and snippets.

@MyITGuy
Created November 18, 2016 20:20
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save MyITGuy/79497012ab8fd3eb33f3d64a48394278 to your computer and use it in GitHub Desktop.
Save MyITGuy/79497012ab8fd3eb33f3d64a48394278 to your computer and use it in GitHub Desktop.
PowerShell: Last time Group Policy was processed
# Get StartTimeHi Int32 value
$startTimeHi = (Get-ItemProperty -Path "Registry::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Extension-List\{00000000-0000-0000-0000-000000000000}").startTimeHi
# Get StartTimeLo Int32 value
$startTimeLo = (Get-ItemProperty -Path "Registry::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Extension-List\{00000000-0000-0000-0000-000000000000}").startTimeLo
# Convert from FileTime
[datetime]::FromFileTime(([Int64] $startTimeHi -shl 32) -bor $startTimeLo)
<# One-liner #>
[datetime]::FromFileTime(([Int64] ((Get-ItemProperty -Path "Registry::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Extension-List\{00000000-0000-0000-0000-000000000000}").startTimeHi) -shl 32) -bor ((Get-ItemProperty -Path "Registry::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Extension-List\{00000000-0000-0000-0000-000000000000}").startTimeLo))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment