File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,16 @@ function Get-CIPPMFAState {
6969 }
7070
7171 if ($CAState.count -eq 0 ) { $CAState.Add (' None' ) | Out-Null }
72+
73+ $assignments = New-GraphGetRequest - uri " https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments?`$ expand=principal" - tenantid $TenantFilter - ErrorAction SilentlyContinue
7274
75+ $adminObjectIds = $assignments |
76+ Where-Object {
77+ $_.principal .' @odata.type' -eq ' #microsoft.graph.user'
78+ } |
79+ ForEach-Object {
80+ $_.principal.id
81+ }
7382
7483 # Interact with query parameters or the body of the request.
7584 $GraphRequest = $Users | ForEach-Object {
@@ -98,6 +107,7 @@ function Get-CIPPMFAState {
98107 $CoveredByCA = ' Not Enforced'
99108 }
100109 }
110+ $IsAdmin = if ($adminObjectIds -contains $_.ObjectId ) { $true } else { $false }
101111
102112 $PerUser = $_.PerUserMFAState
103113
@@ -117,6 +127,7 @@ function Get-CIPPMFAState {
117127 CoveredByCA = $CoveredByCA
118128 CAPolicies = $UserCAState
119129 CoveredBySD = $SecureDefaultsState
130+ IsAdmin = $IsAdmin
120131 RowKey = [string ]($_.UserPrincipalName ).replace(' #' , ' ' )
121132 PartitionKey = ' users'
122133 }
You can’t perform that action at this time.
0 commit comments