Device Assignment Filter - Display name and id instead of solely id
Description of the issue
Currently, when exporting an Intune policy that has one (or multiple) assignments and a filter configured for an assignment, the filter id is exported along with the assignment information. When exporting such a configuration from one tenant and applying to another tenant, the filter id most likely won't match the filter in the other tenant.
There are multiple resources that now have support for display names and ids. The same goes for the groups in the assignment, they also feature both a groupId and a groupDisplayName property, which can be used for applying cross-tenant configuration.
What is your opinion about having an additional property similar to groupDisplayName but for filters, e.g. deviceAndAppManagementAssignmentFilterDisplayName, that holds the display name of the filter? Of course, that means that in Update-DeviceConfigurationPolicyAssignment we have to check if the filter id is valid and if not, lookup the correct id using the filter display name.
Microsoft 365 DSC Version
V1.24.417.1
Which workloads are affected
Intune
The DSC configuration
IntuneDeviceConfigurationTrustedCertificatePolicyWindows10 "IntuneDeviceConfigurationTrustedCertificatePolicyWindows10-displayName"
{
ApplicationId = $ConfigurationData.NonNodeData.ApplicationId;
Assignments = @(
MSFT_DeviceManagementConfigurationPolicyAssignments{
deviceAndAppManagementAssignmentFilterType = 'include'
dataType = '#microsoft.graph.groupAssignmentTarget'
deviceAndAppManagementAssignmentFilterId = '1110c408-9642-4341-a3d2-29d6e15ad3f7'
groupId = '93e59374-a8b1-4aed-8769-86935190cb39'
}
);
CertFileName = "cert.crt";
CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
DestinationStore = "computerCertStoreRoot";
DisplayName = "displayName";
Ensure = "Present";
Id = "redacted";
TenantId = $OrganizationName;
TrustedRootCertificate = "redacted";
}
Verbose logs showing the problem
No response
Environment Information + PowerShell Version
No response