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

Compare-M365DSCConfigurations: ExcludedResources parameter not working as it should #4000

Closed
ricmestre opened this issue Dec 5, 2023 · 0 comments · Fixed by #4001 or #4005
Closed
Labels
Bug Something isn't working Core Engine V1.23.1129.1 Version 1.23.1129.1

Comments

@ricmestre
Copy link
Contributor

Description of the issue

When I added support for excluding resources on Assert-M365DSCBlueprint, New-M365DSCDeltaReport and Compare-M365DSCConfigurations on #3262 I missed that I was only excluding them from the source (tenant) but not from the destination (blueprint) which means that if a certain policy was in both the source and destination, and then excluded in one of the cmdlets mentioned above, it would still appear as a drift that it was missing from the source and present in the destination. Check drift below where I have a policy of type IntuneDeviceConfigurationCustomPolicyWindows10 in both tenant and blueprint and by excluding it then it appears as drift.

The fix is to check if there are any resources to be excluded then exclude them from both source and destination.

Microsoft 365 DSC Version

1.23.1129.1

Which workloads are affected

other

The DSC configuration

N/A

Verbose logs showing the problem

{
        "ResourceName":  "IntuneDeviceConfigurationCustomPolicyWindows10",
        "Key":  [
                    "DisplayName"
                ],
        "KeyValue":  "Windows 10/11 - Custom CSP - Block MS Edge Shortcuts - Custom",
        "Properties":  [
                           {
                               "ValueInDestination":  "Present",
                               "ParameterName":  "_IsInConfiguration_",
                               "ValueInSource":  "Absent"
                           }
                       ],
        "ResourceInstanceName":  "IntuneDeviceConfigurationCustomPolicyWindows10-Windows 10/11 - Custom CSP - Block MS Edge Shortcuts - Custom"
    }

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
@ricmestre ricmestre changed the title Assert-M365DSCBlueprint: ExcludeResources parameter not working as it should Compare-M365DSCConfigurations: ExcludeResources parameter not working as it should Dec 5, 2023
@ricmestre ricmestre changed the title Compare-M365DSCConfigurations: ExcludeResources parameter not working as it should Compare-M365DSCConfigurations: ExcludedResources parameter not working as it should Dec 5, 2023
@andikrueger andikrueger added Bug Something isn't working Core Engine V1.23.1129.1 Version 1.23.1129.1 labels Dec 6, 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 Core Engine V1.23.1129.1 Version 1.23.1129.1
Projects
None yet
2 participants