Security Log – Specific User logon

To filter logon and log off of specific user. Event will be available on target client machine.

<QueryList>
  <Query Id="0" Path="Security">
    <Select Path="Security">*[
      System[(EventID=4634 or EventID=4624)] and 
      EventData[
        Data[@Name='LogonType']='10' or 
        Data[@Name='LogonType']='2'
      ] and
      EventData[Data[@Name='TargetUserName']='some-user-name']
    ]
    </Select>
  </Query>
</QueryList>

Explanation

EventIDDescription
4624Logon
4634Logoff
LogonTypeDescription
2Console
10Remote Desktop

Security Log – Account Locked Out

To filter account lock out “source”. Event will be available in Domain Controllers.

<QueryList>
  <Query Id="0" Path="Security">
    <Select Path="Security">*[
      System[(EventID=4740)] and 
      EventData[Data[@Name='TargetUserName']='some-user-name']
    ]
    </Select>
  </Query>
</QueryList>

Double click to see the details of the event. The “source computer” information will be available in Additional Information > Caller Computer Name field.

Last modified: 20 September 2022