AzureAD/AzureADAssessment

Property Guid not found in Object - $ReferenceIdCache.group.guid

Grubbslinger opened this issue · 4 comments

When running the script I am getting the following error.

InvalidOperation: C:\Users\fakename\Documents\PowerShell\Modules\AzureADAssessment\2.1.52\Invoke-AADAssessmentDataCollection.ps1:250
Line |
250 | $ReferencedIdCache.group.guid | Get-MsGraphResults 'groups/{0 …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'guid' cannot be found on this object. Verify that the property exists.

The line in question is 250

Add nested groups

    $ReferencedIdCache.group.guid | Get-MsGraphResults 'groups/{0}/transitiveMembers/microsoft.graph.group?$count=true&$select=id' -Top 999 -TotalRequests $ReferencedIdCache.group.Count -DisableUniqueIdDeduplication `
    | ForEach-Object { [void]$ReferencedIdCache.group.Add($_.id) }

The final output of the script is not in a zip format as stated in the Readme either nor does it contain the right data for the PowerBI dashboards to work properly. I am unsure what is causing this error. Thanks!

I ran into the same issue and was able to get it running by commenting out the "option 1" code at line 250. And it will output into the proper zip files to get into powerBI. @Grubbslinger

This worked to get everything exported correctly but would love to know how to fix the issue without having to comment it out.

Hi @k3nundrum, @Grubbslinger,

This should be fixed by the latest release (2.2.2).
Do you still have this issue after updating?

The script now checks that the referenced groups is not empty as in this case there is no guid property.

Cédric

@k3nundrum, @Grubbslinger, i'll close the issue. Please tell us you still have the issue.