Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-IntuneWin32AppAssignment returning Excluded value for Property GroupMode for 'All Users' and 'All Devices' #153

Open
Skeb1ns opened this issue Apr 11, 2024 · 1 comment

Comments

@Skeb1ns
Copy link

Skeb1ns commented Apr 11, 2024

The Get-IntuneWin32AppAssignment cmdlet is currently returning the Excluded value for Property GroupMode for 'All Users' and 'All Devices' even if these groups are Included in the assignment scope.

I looked into the cmdlet and I think this behavior occurs because starting on line 187 the $GroupMode variable is declared, the last value Exclude is assigned, the odata.type #microsoft.graph.allDevicesAssignmentTarget is not handled in the switch and the value Exclude is retained and returned in the PSObject.

switch ($Win32AppAssignment.target.'@odata.type') {
                                    "#microsoft.graph.groupAssignmentTarget" {
                                        $GroupMode = "Include"
                                    }
                                    "#microsoft.graph.exclusionGroupAssignmentTarget" {
                                        $GroupMode = "Exclude"
                                    }
                                }
@Skeb1ns
Copy link
Author

Skeb1ns commented Apr 11, 2024

Added #154 as a suggested fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant