У меня есть следующий код Powershell, который запрашивает конечную точку API Graph Microsoft.
Мне нужно отыскать отправку этих результатов в концентратор событий Azure
$ClientID = "826fc487-212b-4e45-9fbb-8059e4b5d3ce" # Should be a ~36 hex character string; insert your info here
$ClientSecret = "9OOrzJ90Kvv97BZ3DQLQXgI/wFezmnJ8DRFMh7K/9Fs=" # Should be a ~44 character string; insert your info here
$tenantdomain = "tenant.onmicrosoft.com" # For example, contoso.onmicrosoft.com
$loginURL = "https://login.microsoft.com"
$resource = "https://graph.microsoft.com"
$body = @{grant_type="client_credentials";resource=$resource;client_id=$ClientID;client_secret=$ClientSecret}
$oauth = Invoke-RestMethod -Method Post -Uri $loginURL/$tenantdomain/oauth2/token?api-version=1.0 -Body $body
Write-Output $oauth
if ($oauth.access_token -ne $null) {
$headerParams = @{'Authorization'="$($oauth.token_type) $($oauth.access_token)"}
$url = "https://graph.microsoft.com/beta/identityRiskEvents"
Write-Output $url
$myReport = (Invoke-WebRequest -UseBasicParsing -Headers $headerParams -Uri $url)
foreach ($event in $myReport.Content){
$SasToken="uGllYoYHJ4etHsTh7yETy6CKFegebfXK4x3e9Lbw4+k="
Write-Output $event
}
} else {
Write-Host "ERROR: No Access Token"
}
пожалуйста, любые идеи