Skip to content

Commit

Permalink
Add support for DeviceTag, DeviceTagNot
Browse files Browse the repository at this point in the history
  • Loading branch information
TristankMS committed May 24, 2021
1 parent 5da04c5 commit 725eee9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Functions/Get-MCASActivity.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,18 @@ function Get-MCASActivity {
[validateset('Native_client', 'Outdated_browser', 'Outdated_operating_system', 'Robot')]
[string[]]$UserAgentTagNot,

# Limits the results to those with device tags equal to the specified value(s).
[Parameter(ParameterSetName = 'List', Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[validateset('HybridJoined', 'IntuneManaged', 'ClientCertificate')]
[string[]]$DeviceTag,

# Limits the results to those with device agent tags not equal to the specified value(s).
[Parameter(ParameterSetName = 'List', Mandatory = $false)]
[ValidateNotNullOrEmpty()]
[validateset('HybridJoined', 'IntuneManaged', 'ClientCertificate')]
[string[]]$DeviceTagNot,

# Limits the results to activities performed by users part of the specified groups.
[Parameter(ParameterSetName = 'List', Mandatory = $false)]
[ValidateNotNullOrEmpty()]
Expand Down Expand Up @@ -392,10 +404,14 @@ function Get-MCASActivity {
}
if ($IPTagNot) { $filterSet += @{'ip.tags' = @{'neq' = ($IPTagNot.GetEnumerator() | ForEach-Object { $IPTagsList.$_ -join ',' }) } }
}
if ($UserAgentTag) { $filterSet += @{'userAgent.tags' = @{'eq' = ($UserAgentTag.GetEnumerator() | ForEach-Object { $UserAgentTagsList.$_ -join ',' }) } }
if ($c) { $filterSet += @{'userAgent.tags' = @{'eq' = ($UserAgentTag.GetEnumerator() | ForEach-Object { $UserAgentTagsList.$_ -join ',' }) } }
}
if ($UserAgentTagNot) { $filterSet += @{'userAgent.tags' = @{'neq' = ($UserAgentTagNot.GetEnumerator() | ForEach-Object { $UserAgentTagsList.$_ -join ',' }) } }
}
if ($DeviceTag){ $filterSet += @{'device.tags' = @{'eq' = ($DeviceTag.GetEnumerator() | ForEach-Object { $DeviceTagsList.$_ -join ',' }) } }
}
if ($DeviceTagNot){ $filterSet += @{'device.tags' = @{'neq' = ($DeviceTagNot.GetEnumerator() | ForEach-Object { $DeviceTagsList.$_ -join ',' }) } }
}

# Simple filters
if ($UserName) { $filterSet += @{'user.username' = @{'eq' = $UserName } }
Expand Down
6 changes: 6 additions & 0 deletions MCAS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ $UserAgentTagsList = [ordered]@{
Robot = '0000002b0000000000000000'
}

$DeviceTagsList = [ordered]@{
HybridJoined = '000000230000000000000000'
IntuneManaged = '000000220000000000000000'
ClientCertificate = '000000060000000000000000'
}

$ReportsList = @{
'Activity by Location' = 'geolocation_summary'
'Browser Use' = 'browser_usage'
Expand Down

0 comments on commit 725eee9

Please sign in to comment.