Index was outside the bounds of the array when calling Invoke-AADAssessmentDataCollection
ztrhgf opened this issue · comments
Ondrej Sebela commented
Error bellow when calling Invoke-AADAssessmentDataCollection
When I debug 2.2.2\internal\Expand-MsGraphRelationship.ps1 it turns out that:
- $inputObject contained one item
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++) {
Cedric commented
HI @ztrhgf,
can you check with our latest preview version?
PS> Install-Module -Name AzureADAssessment -AllowPrerelease
Cédric
Jason Thompson commented
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.