Created
October 28, 2013 14:28
-
-
Save BenNeise/7197673 to your computer and use it in GitHub Desktop.
Returns, via the AppSense Event log, the Logon Time, Node Name, Action, Start Time and Duration of AppSense logon actions. Useful for tuning and optimising AppSense logons. The Policy Configuration item "Send events to the Appsense event log" should be enabled for this to work.
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
Function Get-AppSenseLogonTimes { | |
<# | |
.Synopsis | |
Returns information about AppSense logon events as recorded by the AppSense event log | |
.Description | |
Returns, via the AppSense Event log, the Logon Time, Node Name, Action, Start Time and Duration of AppSense logon actions. | |
Useful for tuning and optimising AppSense logons. | |
The Policy Configuration item "Send events to the Appsense event log" should be enabled for this to work. | |
.Parameter ComputerName | |
The target computer name. | |
.Example | |
Gets AppSense Logon times from Server1 | |
Get-AppSenseLogonTimes -ComputerName "Server1" | |
.Notes | |
Ben Neise 28/10/2013 | |
#> | |
Param ( | |
[String] | |
$ComputerName = $env:localhost | |
) | |
Try { | |
Get-Eventlog -ComputerName $ComputerName -LogName AppSense | Select-Object ` | |
@{Name="Logon Time";Expression={@($_.ReplacementStrings[0])}}, | |
@{Name="Node Name";Expression={@($_.ReplacementStrings[1])}}, | |
@{Name="Action";Expression={@($_.ReplacementStrings[2])}}, | |
@{Name="Start Time";Expression={@($_.ReplacementStrings[3])}}, | |
@{Name="Duration";Expression={[int]$_.ReplacementStrings[4]}} | |
} | |
Catch { | |
Write-Error "Can't get AppSense logs from $ComputerName" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment