Created
November 18, 2016 20:20
-
-
Save MyITGuy/79497012ab8fd3eb33f3d64a48394278 to your computer and use it in GitHub Desktop.
PowerShell: Last time Group Policy was processed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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