Skip to content

Instantly share code, notes, and snippets.

@tora1104
tora1104 / AADRiskySigninsNotification.ps1
Last active May 12, 2021 13:14 — forked from mrik23/AADRiskySigninsNotification.ps1
PowerShell script using the Microsoft Function App and Microsoft Graph REST API to retrieve Azure AD Risk Detection events with email notification. Go to https://medium.com/@zaab_it/azure-ad-risky-sign-ins-email-notification-6cbfac32f6de for more details. Rewritten with Risk Detections as Risky Sign Ins is no longer supported in Azure.
<#
Changes from the original
This script retrieves Azure Active Directory Risk Detection Events as Azure no longer supports the Risky Sign Ons. Only the At Risk and Confirmed Compromised events from the last 3 days will be sent.
Removed the ipInfo portion.
#>
$ClientID = $env:ClientID
$ClientSecret = $env:ClientSecret
$tenantDomain = $env:TenantDomain