Skip to content

Commit

Permalink
Modified Get-LogUserAssist.ps1 to return Key LastWriteTime in ISO for…
Browse files Browse the repository at this point in the history
…mat for easier sorting. Added analysis script to sort UserAssist data based on key LastWriteTime.
  • Loading branch information
davehull committed Jun 26, 2014
1 parent 8edf8f0 commit fd6ab36
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions Analysis/log/Get-LogUserAssistValueByDate.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<#
Get-LogUserAssistValueByDate.ps1
Requires logparser.exe in path
Returns UserAssist data sorted by KeyLastWritetime ascending
This script expects files matching the *LogUserAssist.tsv pattern to be in the
current working directory.
#>


if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
User,
Subkey,
KeyLastWriteTime,
Value,
Count,
PSComputerName
FROM
*LogUserAssist.tsv
ORDER BY
KeyLastWriteTime ASC
"@

& logparser -i:tsv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery"

} else {
$ScriptName = [System.IO.Path]::GetFileName($MyInvocation.ScriptName)
"${ScriptName} requires logparser.exe in the path."
}
2 changes: 1 addition & 1 deletion Modules/Log/Get-LogUserAssist.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Update-TypeData -TypeName Microsoft.Win32.RegistryKey -MemberType ScriptProperty
}
else {
# Return datetime object:
[datetime]::FromFileTime($LastWriteTime)
Get-Date([datetime]::FromFileTimeUtc($LastWriteTime)) -Format yyyyMMddThh:mm:ss
}
}
<# End MS Limited Public Licensed code #>
Expand Down

0 comments on commit fd6ab36

Please sign in to comment.