Skip to content

Instantly share code, notes, and snippets.

@darrenjrobinson
Last active December 4, 2018 23:39
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 darrenjrobinson/73693aca213adf80c2411bb25ad21f5d to your computer and use it in GitHub Desktop.
Save darrenjrobinson/73693aca213adf80c2411bb25ad21f5d to your computer and use it in GitHub Desktop.
$TenantDomain = "customer.com.au"
$topResults = 10
$reportContent = @()
$headerParams = @{'Authorization'="$($Authorization.token_type) $($Authorization.access_token)"}
# https://msdn.microsoft.com/en-us/library/azure/ad/graph/howto/azure-ad-reports-and-events-preview#MimSsprActivityEvent
# MimSsgmGroupActivityEvent
$url = 'https://graph.windows.net/' + $tenantdomain + "/reports/mimSsgmGroupActivityEvents?api-version=beta&`$top=$topResults"
# Returns a JSON document for the "MimSsgmGroupActivityEvent" report
$MIMGroupActivityEvent = (Invoke-WebRequest -Headers $headerParams -Uri $url).Content | ConvertFrom-Json
$MIMGroupActivityEvent.value
# MimSsprActivityEvent
$url = 'https://graph.windows.net/' + $tenantdomain + "/reports/mimSsprActivityEvents?api-version=beta&`$top=$topResults"
# Returns a JSON document for the "MimSsprActivityEvent" report
$MIMssprActivityEvent = (Invoke-WebRequest -Headers $headerParams -Uri $url).Content | ConvertFrom-Json
$MIMssprActivityEvent.value
# MimSsprRegistrationActivityEvent
$url = 'https://graph.windows.net/' + $tenantdomain + "/reports/mimSsprRegistrationActivityEvents?api-version=beta&`$top=$topResults"
# Returns a JSON document for the "MimSsprRegistrationActivityEvent" report
$MIMssprRegistrations = (Invoke-WebRequest -Headers $headerParams -Uri $url).Content | ConvertFrom-Json
$MIMssprRegistrations.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment