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

Issue with MSFT_IntuneDeviceAndAppManagementAssignmentFilter #2788

Closed
hvdbrink opened this issue Jan 16, 2023 · 0 comments · Fixed by #2787 or #2800
Closed

Issue with MSFT_IntuneDeviceAndAppManagementAssignmentFilter #2788

hvdbrink opened this issue Jan 16, 2023 · 0 comments · Fixed by #2787 or #2800
Assignees
Labels
Bug Something isn't working Intune

Comments

@hvdbrink
Copy link

hvdbrink commented Jan 16, 2023

Details of the scenario you tried and the problem that is occurring

After i've created the mof file, I start the DSC configuration and let it run it will create new device filters over and over again.

Verbose logs showing the problem

Suggested solution to the issue

try
    {
        if (-not [System.String]::IsNullOrEmpty($Identity))
        {
            $assignmentFilter = Get-MgDeviceManagementAssignmentFilter -DeviceAndAppManagementAssignmentFilterId $Identity -ErrorAction Stop
        }
        elseif ($null -eq $assignmentFilter)
        {
            Write-Verbose -Message "No assignment filter with Identity {$Identity} was found."

            [array]$assignmentFilter = Get-MgDeviceManagementAssignmentFilter -All | Where-Object -FilterScript { $_.DisplayName -eq $DisplayName }
            if ($assignmentFilter.Length -gt 2)

Change above to if instead of elseif

The DSC configuration that is used to reproduce the issue (as detailed as possible)

IntuneDeviceAndAppManagementAssignmentFilter 8cf58690-4ae5-464e-8177-5c5fc990f64a
        {
            Credential           = $Credscredential;
            Description          = "iOS/iPad COPE filter";
            DisplayName          = "RWOV - Filter iOS/iPad COPE";
            Ensure               = "Present";
            Identity             = "5b739e48-7fb0-4fa9-8fd2-9c3a93753265";
            Platform             = "iOS";
            Rule                 = "(device.enrollmentProfileName -eq `"RWOV - ABM iOS/iPadOS COPE Enrollment`")";
}

The operating system the target node is running

Version of the DSC module that was used ('dev' if using current dev branch)

1.23.111.1

@ykuijs ykuijs self-assigned this Jan 16, 2023
@ykuijs ykuijs added Bug Something isn't working Intune labels Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Intune
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants