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

IntuneAntivirusPolicyWindows10SettingCatalog: Cannot deploy again #5373

Closed
ricmestre opened this issue Nov 9, 2024 · 0 comments · Fixed by #5374 or #5397
Closed

IntuneAntivirusPolicyWindows10SettingCatalog: Cannot deploy again #5373

ricmestre opened this issue Nov 9, 2024 · 0 comments · Fixed by #5374 or #5397
Labels
Bug Something isn't working Intune V1.24.1106.3 Version 1.24.1106.3

Comments

@ricmestre
Copy link
Contributor

Description of the issue

@FabienTschanz Some of your changes made this one break again, I'm not able to deploy it, could you please check what's going on?

Microsoft 365 DSC Version

1.24.1106.3

Which workloads are affected

Intune

The DSC configuration

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

Configuration IntuneAntivirusPolicyWindows10SettingCatalog
{
    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.24.1106.3'

    Node localhost
    {
        IntuneAntivirusPolicyWindows10SettingCatalog "IntuneAntivirusPolicyWindows10SettingCatalog-IntuneAntivirusPolicyWindows10SettingCatalog_1"
        {
            AllowArchiveScanning                = "0";
            AllowBehaviorMonitoring             = "1";
            AllowCloudProtection                = "1";
            AllowEmailScanning                  = "1";
            AllowFullScanOnMappedNetworkDrives  = "0";
            AllowFullScanRemovableDriveScanning = "1";
            AllowIntrusionPreventionSystem      = "1";
            AllowIOAVProtection                 = "1";
            AllowRealtimeMonitoring             = "1";
            AllowScanningNetworkFiles           = "1";
            AllowScriptScanning                 = "1";
            AllowUserUIAccess                   = "1";
            Assignments                         = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    groupDisplayName = 'DummyGroupExclude'
                    dataType = '#microsoft.graph.exclusionGroupAssignmentTarget'
                    groupId = '053dc89a-be83-411a-bad3-909904b7239e'
                }
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    groupDisplayName = 'DummyGroupInclude'
                    dataType = '#microsoft.graph.groupAssignmentTarget'
                    groupId = 'b0b8fd3f-af2a-453b-be57-80182d599f02'
                }
            );
            AvgCPULoadFactor                    = 30;
            CheckForSignaturesBeforeRunningScan = "1";
            CloudBlockLevel                     = "4";
            CloudExtendedTimeout                = 20;
            Credential                          = $Credscredential;
            DaysToRetainCleanedMalware          = 30;
            Description                         = "Windows Defender Antivirus is the next-generation protection component of Microsoft Defender for Endpoint. Next-generation protection brings together machine learning, big-data analysis, in-depth threat resistance research, and cloud infrastructure to protect devices in your enterprise organization.";
            DisableCatchupFullScan              = "1";
            DisableCatchupQuickScan             = "1";
            DisplayName                         = "IntuneAntivirusPolicyWindows10SettingCatalog_1";
            EnableLowCPUPriority                = "1";
            EnableNetworkProtection             = "2";
            Ensure                              = "Present";
            ExcludedExtensions                  = @("*.ost","*.pst","*.oab","*.srs");
            ExcludedPaths                       = @("%windir%\SoftwareDistribution\Datastore","%windir%\SoftwareDistribution\Datastore\Logs","%allusersprofile%\NTUser.pol","%SystemRoot%\System32\GroupPolicy\Machine\Registry.pol","%SystemRoot%\System32\GroupPolicy\User\Registry.pol","%windir%\SoftwareDistribution\Datastore\Datastore.edb","%windir%\SoftwareDistribution\Datastore\Logs\Edb*.jrs","%windir%\SoftwareDistribution\Datastore\Logs\Edb.chk","%windir%\SoftwareDistribution\Datastore\Logs\Tmp.edb","%windir%\Security\Database*.edb","%windir%\Security\Database*.log","%windir%\Security\Database*.jrs","%windir%\Security\Database*.csv","%windir%\Security\Database*.sdb","%windir%\Security\Database*.chk","%windir%\Security\Database*.xml","%windir%\Security\Database*.cmtx");
            Identity                            = "68fc86d0-c6a3-4135-813b-3d53c5dcc190";
            PUAProtection                       = "2";
            RealTimeScanDirection               = "0";
            templateId                          = "804339ad-1553-4478-a742-138fb5807418_1";
        }
    }
}

IntuneAntivirusPolicyWindows10SettingCatalog -ConfigurationData .\ConfigurationData.psd1 -Credential $Credential

Verbose logs showing the problem

VERBOSE: [REDACTED]:
[[IntuneAntivirusPolicyWindows10SettingCatalog]IntuneAntivirusPolicyWindows10SettingCatalog-IntuneAntivirusPolicyWindows10SettingCatalog_1] Creating new Endpoint Protection Policy {IntuneAntivirusPolicyWindows10SettingCatalog_1}
[] : The request is invalid. 
+ CategoryInfo          : InvalidOperation: ({ Headers = , b...urationPolicy }:) [], CimException
+ FullyQualifiedErrorId : Microsoft.Graph.Beta.PowerShell.Cmdlets.NewMgBetaDeviceManagementConfigurationPolicy_Create
+ PSComputerName        : localhost

Environment Information + PowerShell Version

Win11/PS5.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.24.1106.3 Version 1.24.1106.3
Projects
None yet
2 participants