almenscorner / IntuneCD

Tool to backup, update and document configurations in Intune
MIT License
277 stars 35 forks source link

[BUG] Exclude of "assignments" not supported #189

Closed CubeWT closed 5 months ago

CubeWT commented 5 months ago

Describe the bug As per wiki "assignments" should be supported for "-exclude" but IntuneCD throws an error if "assignments" is used.

To Reproduce

  1. Run "IntuneCD-startupdate -m 1 --exclude assignments"

Expected behavior IntuneCD creates objects without the corresponding assignments

Screenshots image

Run type (please complete the following information):

Additional context

usage: IntuneCD-startupdate [-h] [-p PATH] [-m MODE] [-a LOCALAUTH] [-c] [-i]
                            [-u]
                            [-e {AppConfigurations,AppProtection,Compliance,NotificationTemplate,Profiles,GPOConfigurations,AppleEnrollmentProfile,WindowsEnrollmentProfile,EnrollmentStatusPage,Filters,Intents,ProactiveRemediation,PowershellScripts,ShellScripts,ConfigurationPolicies,ConditionalAccess,EnrollmentConfigurations,DeviceManagementSettings,CustomAttributes,DeviceCategories,Roles,ScopeTags,DeviceCompliancePolicies,ComplianceScripts,ReusablePolicySettings,entraAuthenticationFlowsPolicy,entraAuthenticationMethods,entraAuthorizationPolicy,entraB2BPolicy,entraDeviceRegistrationPolicy,entraExternalIdentitiesPolicy,entraGroupSettings,entraRoamingSettings,entraSecurityDefaults,entraSSPR,entraAuthenticationMethodsConfigurations,entraDomains} [{AppConfigurations,AppProtection,Compliance,NotificationTemplate,Profiles,GPOConfigurations,AppleEnrollmentProfile,WindowsEnrollmentProfile,EnrollmentStatusPage,Filters,Intents,ProactiveRemediation,PowershellScripts,ShellScripts,ConfigurationPolicies,ConditionalAccess,EnrollmentConfigurations,DeviceManagementSettings,CustomAttributes,DeviceCategories,Roles,ScopeTags,DeviceCompliancePolicies,ComplianceScripts,ReusablePolicySettings,entraAuthenticationFlowsPolicy,entraAuthenticationMethods,entraAuthorizationPolicy,entraB2BPolicy,entraDeviceRegistrationPolicy,entraExternalIdentitiesPolicy,entraGroupSettings,entraRoamingSettings,entraSecurityDefaults,entraSSPR,entraAuthenticationMethodsConfigurations,entraDomains} ...]]
                            [-r] [-g] [--remove] [--intunecdmonitor]
                            [-f FRONTEND] [--entraupdate]
                            [--scopes SCOPES [SCOPES ...]] [-v]
IntuneCD-startupdate: error: argument -e/--exclude: invalid choice: 'assignments' (choose from 'AppConfigurations', 'AppProtection', 'Compliance', 'NotificationTemplate', 'Profiles', 'GPOConfigurations', 'AppleEnrollmentProfile', 'WindowsEnrollmentProfile', 'EnrollmentStatusPage', 'Filters', 'Intents', 'ProactiveRemediation', 'PowershellScripts', 'ShellScripts', 'ConfigurationPolicies', 'ConditionalAccess', 'EnrollmentConfigurations', 'DeviceManagementSettings', 'CustomAttributes', 'DeviceCategories', 'Roles', 'ScopeTags', 'DeviceCompliancePolicies', 'ComplianceScripts', 'ReusablePolicySettings', 'entraAuthenticationFlowsPolicy', 'entraAuthenticationMethods', 'entraAuthorizationPolicy', 'entraB2BPolicy', 'entraDeviceRegistrationPolicy', 'entraExternalIdentitiesPolicy', 'entraGroupSettings', 'entraRoamingSettings', 'entraSecurityDefaults', 'entraSSPR', 'entraAuthenticationMethodsConfigurations', 'entraDomains')
almenscorner commented 5 months ago

It is a typo in the Wiki, assignments will not be updated during an IntuneCD-startupdate run if the --update-assignments argument is not used. I will correct the Wiki!

CubeWT commented 5 months ago

Ok but with which parameter can i run "IntuneCD-startupdate" that no assignments will be created? Currently if i run "IntuneCD-startupdate -m 1" missing configurations will be created with assignment, how can i only create the configuration?

almenscorner commented 5 months ago

Right so this will be a change in 2.3.0 set to be released today. In the current version assignment will be added when creating the configurations, in 2.3.0, assignment will only ever be updated on creation or updates if the --update-assignment argument is used keeping it consistent