Microsoft Entra ID Protection e Microsoft Graph PowerShell

Microsoft Graph è l'endpoint dell'API unificata Microsoft e la home delle API microsoft Entra ID Protection.Microsoft Graph is the Microsoft unified API and the home of Microsoft Entra ID Protection APIs. Questo articolo illustra come usare Microsoft Graph PowerShell SDK per gestire utenti rischiosi usando PowerShell. Le organizzazioni che vogliono eseguire query sulle API Microsoft Graph direttamente possono usare l'articolo Esercitazione: Identificare e correggere i rischi usando le API Microsoft Graph per iniziare questo percorso.

Per completare correttamente questa esercitazione, assicurarsi di disporre dei prerequisiti necessari:

  • Microsoft Graph PowerShell SDK è installato. Per altre informazioni, vedere l'articolo Installare Microsoft Graph PowerShell SDK.

  • Microsoft Graph PowerShell usando un ruolo security Amministrazione istrator. Sono necessarie le autorizzazioni delegate IdentityRiskEvent.Read.All, IdentityRiskyUser.ReadWrite.All Or IdentityRiskyUser.ReadWrite.All. Per impostare le autorizzazioni su IdentityRiskEvent.Read.All e IdentityRiskyUser.ReadWrite.All, eseguire:

    Connect-MgGraph -Scopes "IdentityRiskEvent.Read.All","IdentityRiskyUser.ReadWrite.All"
    

Se si usa l'autenticazione solo app, vedere l'articolo Usare l'autenticazione solo app con Microsoft Graph PowerShell SDK. Per registrare un'applicazione con le autorizzazioni dell'applicazione necessarie, preparare un certificato ed eseguire:

Connect-MgGraph -ClientID YOUR_APP_ID -TenantId YOUR_TENANT_ID -CertificateName YOUR_CERT_SUBJECT ## Or -CertificateThumbprint instead of -CertificateName

Elencare i rilevamenti a rischio con PowerShell

È possibile recuperare i rilevamenti dei rischi dalle proprietà di un rilevamento dei rischi in Protezione ID.

# List all anonymizedIPAddress risk detections
Get-MgRiskDetection -Filter "RiskType eq 'anonymizedIPAddress'" | Format-Table UserDisplayName, RiskType, RiskLevel, DetectedDateTime

# List all high risk detections for the user 'User01'
Get-MgRiskDetection -Filter "UserDisplayName eq 'User01' and Risklevel eq 'high'" | Format-Table UserDisplayName, RiskType, RiskLevel, DetectedDateTime

Elencare gli utenti a rischio con PowerShell

È possibile recuperare gli utenti rischiosi e le relative cronologie rischiose in Protezione ID.

# List all high risk users
Get-MgRiskyUser -Filter "RiskLevel eq 'high'" | Format-Table UserDisplayName, RiskDetail, RiskLevel, RiskLastUpdatedDateTime

#  List history of a specific user with detailed risk detection
Get-MgRiskyUserHistory -RiskyUserId 375844b0-2026-4265-b9f1-ee1708491e05| Format-Table RiskDetail, RiskLastUpdatedDateTime, @{N="RiskDetection";E={($_). Activity.RiskEventTypes}}, RiskState, UserDisplayName

Confermare la compromissione degli utenti con PowerShell

È possibile confermare che gli utenti sono stati compromessi e contrassegnarli come utenti ad alto rischio in Protezione ID.

# Confirm Compromised on two users
Confirm-MgRiskyUserCompromised -UserIds "577e09c1-5f26-4870-81ab-6d18194cbb51","bf8ba085-af24-418a-b5b2-3fc71f969bf3"

Ignorare gli utenti rischiosi usando PowerShell

È possibile ignorare in blocco gli utenti rischiosi in Protezione ID.

# Get a list of high risky users which are more than 90 days old
$riskyUsers= Get-MgRiskyUser -Filter "RiskLevel eq 'high'" | where RiskLastUpdatedDateTime -LT (Get-Date).AddDays(-90)
# bulk dismiss the risky users
Invoke-MgDismissRiskyUser -UserIds $riskyUsers.Id

Passaggi successivi