-
Notifications
You must be signed in to change notification settings - Fork 531
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
Cannot convert the "MSFT_DeviceManagementConfigurationPolicyAssignments" value of type #2768
Comments
Hi @hvdbrink, could you confirm if the issue is with IntuneApplicationControlPolicyWindows10 or with the IntuneAppProtectionPolicyAndroid/iOS please Thanks |
Added the error with some verbose information from the import, the first one is from iOS, i'm checking if this also happens for android and W10.
|
Issue occurs when the policy does not exist yet. In that case, the code returns the nullReturn value, which is basically the inputted data with Ensure=Absent. Lines 69 to 81 in 74c7cf5
If the test method then processes the returned information from the Get method, the Assignment parameter contains the CIM instance, which it is unable to convert into a hashtable resulting in the error: Lines 357 to 377 in 74c7cf5
Now checking what has to be changed to fix the issue. |
Changed the nullReturn value to only export the mandatory parameters instead of copying the PSBoundParameters variable. Code now works as expected. Fix will be included in a next PR |
Details of the scenario you tried and the problem that is occurring
I'm trying to import DSC resources to intune after exporting them from another tenant.
Creating the MOF goes on without a issue, but once I start the configuration and it gets to the App Configuration Policies, those fail because the assignments can't be read.
Verbose logs showing the problem
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
This is the full configuration for the app that fails, doesn't matter which one it is, Android, iOS
{
IntuneAppConfigurationPolicy c304e0a4-75b6-464d-84d6-ebcdbc4427b4
{
Assignments =
MSFT_DeviceManagementConfigurationPolicyAssignments{
deviceAndAppManagementAssignmentFilterType = 'none'
dataType = '#microsoft.graph.groupAssignmentTarget'
groupId = '9eef68d0-e0ec-4d1e-9cbb-568d42a86142'
};
Credential = $Credscredential;
CustomSettings = @(
MSFT_IntuneAppConfigurationPolicyCustomSetting {
name = ' WebProtection'
value = 'true'
}
MSFT_IntuneAppConfigurationPolicyCustomSetting {
name = 'DefenderEndUserTrustFlowEnable'
value = 'false'
}
MSFT_IntuneAppConfigurationPolicyCustomSetting {
name = 'DefenderNetworkProtectionAutoRemediation'
value = 'true'
}
MSFT_IntuneAppConfigurationPolicyCustomSetting {
name = 'DefenderNetworkProtectionPrivacy'
value = 'true'
}
MSFT_IntuneAppConfigurationPolicyCustomSetting {
name = 'DefenderExcludeURLInReport '
value = 'false'
}
MSFT_IntuneAppConfigurationPolicyCustomSetting {
name = 'DefenderSendFeedback '
value = 'false'
});
Description = "Configuration for MAM device concerning MS defender for iOS";
DisplayName = "$OrganizationName -iOS-MS defender ATP MAM";
Ensure = "Present";
}
The operating system the target node is running
OsName : Microsoft Windows 11 Pro
OsOperatingSystemSKU : 48
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage : en-US
OsMuiLanguages : {en-US, en-GB}
Version of the DSC module that was used ('dev' if using current dev branch)
Release 1.23.111.1
The text was updated successfully, but these errors were encountered: