AzureAD / AzureADAssessment

Tooling for assessing an Azure AD tenant state and configuration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Index was outside the bounds of the array when calling Invoke-AADAssessmentDataCollection

ztrhgf opened this issue · comments

Error bellow when calling Invoke-AADAssessmentDataCollection

image

When I debug 2.2.2\internal\Expand-MsGraphRelationship.ps1 it turns out that:

  • $inputObject contained one item
    image when final block started. But $results variable was empty, because there was no user in "Exchange administrator" role! Therefore error on line [array] $refValues = $Results[$i]
  • btw $uri contained directoryRoles/{0}/members/$ref

SOLUTION?
In 2.2.2\internal\Expand-MsGraphRelationship.ps1 modify both foreach
from:
for ($i = 0; $i -lt $InputObjects.Count; $i++) {
to:
for ($i = 0; $i -lt $Results.Count; $i++) {

HI @ztrhgf,
can you check with our latest preview version?

PS> Install-Module -Name AzureADAssessment -AllowPrerelease

Cédric

The code that led to this error has been completely replaced with roleDefinitions api so this should be resolved now. Let us know if you still see any errors.