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

IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10: Can be deployed but it never finds the just created policy so it keeps creating new ones with same name #3964

Closed
ricmestre opened this issue Nov 29, 2023 · 0 comments · Fixed by #4306 or #4330
Labels
Bug Something isn't working Intune V1.23.1122.1 Version 1.23.1122.1

Comments

@ricmestre
Copy link
Contributor

Description of the issue

I'm able to deploy a IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10 policy, nevertheless Test-DSCConfiguration says it's in non-desired state, not only that if I run Start-DSCConfiguration on the same MOF without changing anything it keeps creating new policy with exactly the same DisplayName since it never finds the policy by its name, see below this is already after having 2 policies created and it created a 3rd one.

[[IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10]IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10-IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10_1] Could not find an Intune Device
Configuration Network Boundary Policy for Windows10 with Id {16c280a3-a04f-4847-b3bb-3cef06cb2be3}
VERBOSE: [REDACTED]:
[[IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10]IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10-IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10_1] Could not find an Intune Device
Configuration Network Boundary Policy for Windows10 with DisplayName {IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10_1}

Microsoft 365 DSC Version

1.23.1122.1

Which workloads are affected

other

The DSC configuration

# Generated with Microsoft365DSC version 1.23.1122.1
# For additional information on how to use Microsoft365DSC, please visit https://aka.ms/M365DSC
param (
    [parameter()]
    [System.Management.Automation.PSCredential]
    $Credential
)

Configuration IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10
{
    param (
        [parameter()]
        [System.Management.Automation.PSCredential]
        $Credential
    )

    if ($null -eq $Credential)
    {
        <# Credentials #>
        $Credscredential = Get-Credential -Message "Credentials"

    }
    else
    {
        $CredsCredential = $Credential
    }

    $OrganizationName = $CredsCredential.UserName.Split('@')[1]

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.23.1122.1'

    Node localhost
    {
        IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10 "IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10-IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10_1"
        {
            Assignments                   = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    dataType = '#microsoft.graph.groupAssignmentTarget'
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    groupId = 'b0b8fd3f-af2a-453b-be57-80182d599f02'
                }
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    dataType = '#microsoft.graph.exclusionGroupAssignmentTarget'
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    groupId = '053dc89a-be83-411a-bad3-909904b7239e'
                }
            );
            Credential                    = $CredsCredential;
            DisplayName                   = "IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10_1";
            Ensure                        = "Present";
            Id                            = "16c280a3-a04f-4847-b3bb-3cef06cb2be3";
            SupportsScopeTags             = $True;
            WindowsNetworkIsolationPolicy = MSFT_MicrosoftGraphwindowsNetworkIsolationPolicy{
                EnterpriseIPRanges = @(
                    MSFT_MicrosoftGraphIpRange1{
                        UpperAddress = '1.1.1.255'
                        LowerAddress = '1.1.1.0'
                        odataType = '#microsoft.graph.iPv4Range'
                    }
                )
                EnterpriseIPRangesAreAuthoritative = $True
                EnterpriseNetworkDomainNames = 'domain.com'
                EnterpriseProxyServersAreAuthoritative = $True
            };
        }
    }
}

IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10 -ConfigurationData .\ConfigurationData.psd1 -Credential $Credential

Verbose logs showing the problem

[[IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10]IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10-IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10_1] Could not find an Intune Device
Configuration Network Boundary Policy for Windows10 with Id {16c280a3-a04f-4847-b3bb-3cef06cb2be3}
VERBOSE: [REDACTED]:
[[IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10]IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10-IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10_1] Could not find an Intune Device
Configuration Network Boundary Policy for Windows10 with DisplayName {IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10_1}

Environment Information + PowerShell Version

OsName               : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage           : en-US
OsMuiLanguages       : {en-US, pt-PT}

Name                           Value
----                           -----
PSVersion                      5.1.22621.2428
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2428
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
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 V1.23.1122.1 Version 1.23.1122.1
Projects
None yet
2 participants