Rewrite group check script to not use AD libs #120605

This commit is contained in:
Jurjen Ladenius
2025-07-17 14:45:02 +02:00
parent 847173c58e
commit b6328c1185
4 changed files with 228 additions and 114 deletions

View File

@@ -30,7 +30,8 @@ function GetEligibleAssignments {
[string] $scope
)
$access_token = (Get-AzAccessToken -TenantId "e9792fd7-4044-47e7-a40d-3fba46f1cd09").Token
$access_token_secure = (Get-AzAccessToken -TenantId "e9792fd7-4044-47e7-a40d-3fba46f1cd09").Token
$access_token = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($access_token_secure))
$url = "https://management.azure.com/$scope/providers/Microsoft.Authorization/roleEligibilityScheduleInstances?api-version=2020-10-01&`$filter=atScope()"