Skip to content

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

@Skeb1ns

Description

@Skeb1ns

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"
                                    }
                                }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions