ThomasKur / M365Documentation

Automatic Microsoft 365 Documentation to simplify the life of admins and consultants.
Other
300 stars 45 forks source link

Excluded groups being reported as included #3

Closed paulsym7 closed 2 years ago

paulsym7 commented 3 years ago

After running the Get-M365Doc -Components Intune and Write-M365DocJson commands, when querying the resulting json file I have noticed that groups that are shown as excluded from assignments in the Intune portal are being reported as included.

ExcludedGroups

adbjma commented 2 years ago

I'm running the 3.1.2 version and I still can't see that groups used to be excluding assignment are showed as excluded. Also the member count is 0. The group "AAD-Intune-DD-Exclusions-Users" is an exclusion group, what output should be expected when an exclusion group is used?

image

paulsym7 commented 1 year ago

Hi Thomas,

I have recently revisited the project I was working on when I first reported this issue and noticed that it is still happening. After doing a bit of testing and troubleshooting I believe I have found the solution. Line 86 of the Get-AssignmentDetailSingle.ps1 script should read if($Assignment.target.'@odata.type' -imatch 'exclusion'){ instead of if($Assignment.'@odata.type' -imatch 'exclusion'){. After updating the code and rerunning the Get-M365Doc and Write-M365DocJson commands I now get the expected output:

image

adbjma commented 1 year ago

I saw the note from @paulsym7 and tried to update the Get-AssignmentDetailSingle.ps1 but the doc file still show's the same error with all groups as assigned and not exclusions groups. Not sure how you did this @paulsym7. But it would be very nice if we can have this bug fixed @ThomasKur , this is really a deal breaker for me to use this excellent tool.