Connect-MgGraph -ClientID YOUR_APP_ID -TenantId YOUR_TENANT_ID -CertificateName YOUR_CERT_SUBJECT ## Or -CertificateThumbprint instead of -CertificateName
使用 PowerShell 列出風險偵測
透過 ID Protection 中風險偵測的屬性可以擷取風險偵測。
PowerShell
# List all anonymizedIPAddress risk detectionsGet-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
使用 PowerShell 列出風險性使用者
您可以在 ID Protection 中,擷取風險性使用者和其風險記錄。
PowerShell
# List all high risk usersGet-MgRiskyUser -Filter"RiskLevel eq 'high'" | Format-Table UserDisplayName, RiskDetail, RiskLevel, RiskLastUpdatedDateTime
# List history of a specific user with detailed risk detectionGet-MgRiskyUserHistory -RiskyUserId00aa00aa-bb11-cc22-dd33-44ee44ee44ee | Format-Table RiskDetail, RiskLastUpdatedDateTime, @{N="RiskDetection";E={($_). Activity.RiskEventTypes}}, RiskState, UserDisplayName
使用 PowerShell 確認遭入侵的使用者
您可以在 ID Protection 中確認遭入侵的使用者,並以旗標標示這些使用者為高風險使用者。
PowerShell
# Confirm Compromised on two usersConfirm-MgRiskyUserCompromised -UserIds"11bb11bb-cc22-dd33-ee44-55ff55ff55ff","22cc22cc-dd33-ee44-ff55-66aa66aa66aa"
使用 PowerShell 關閉風險性使用者
您可以在 ID Protection 中,大量關閉風險性使用者。
PowerShell
# 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 usersInvoke-MgDismissRiskyUser -UserIds$riskyUsers.Id