Answer the question
In order to leave comments, you need to log in
How to highlight certain values by date?
I welcome everyone!
There is a script that collects certain events from the server logs.
$servername = "111.domain.com"
$username = "DOMAIN\user"
[xml]$equery = @"
<QueryList>
<Query Id="0" Path="Microsoft-Windows-TerminalServices-Gateway/Operational">
<Select Path="Microsoft-Windows-TerminalServices-Gateway/Operational">*[System[(EventID=303)]] and *[UserData[EventInfo[(Username='$username')]]]</Select>
</Query>
</QueryList>
"@
Get-WinEvent -ComputerName $servername -FilterXML $equery |
Select-Object TimeCreated, @{Name="SessionDuration";Expression={$_.Properties[6].Value}},
@{Name="User";Expression={$_.Properties[0].Value}},
@{Name="Source Network Address";Expression={$_.Properties[1].Value}},
@{Name="Resource";Expression={$_.Properties[3].Value}},MachineName | Out-GridView
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question