Skip to content

Instantly share code, notes, and snippets.

@nmanzi
Created September 2, 2018 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmanzi/ed59c340bff352b67fa6bb8b8b38e8a6 to your computer and use it in GitHub Desktop.
Save nmanzi/ed59c340bff352b67fa6bb8b8b38e8a6 to your computer and use it in GitHub Desktop.
Queries the Horizon View Events DB for unique users logging into a broker from outside of local networks.
select distinct event_data.StrValue
from (select distinct event.EventID, event_data.StrValue
from event inner join viewevents.dbo.event_data
on event_data.EventID = ViewEvents.dbo.event.EventID
where EventType = 'BROKER_USERLOGGEDIN' and
Time >= '2017-05-01' and
event_data.StrValue NOT LIKE '10.%'
and event_data.Name = 'ClientIPAddress') t inner join ViewEvents.dbo.event_data on t.EventID = ViewEvents.dbo.event_data.EventID
where event_data.Name = 'UserDisplayName'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment