Micke-K/IntuneManagement

Failing to Upload some ADMX Files, but others succeed

Opened this issue · 19 comments

@Micke-K I manually imported 10 ADMX and their associated ADML files into Intune and then configured an Administrative template. However, when I try to use Intune Manager to import the ADMX files that I exported only some succeed. The ones that fail all fail with the same error: Failed to invoke MS Graph with URL https://graph.microsoft.us/beta/deviceManagement/groupPolicyUploadedDefinitionFiles (Request ID: bdb29314-341c-406e-9f12-20e4e7c0dceb). Status code: BadRequest. Response message: . Response message: Content Parsing exception: Data at the root level is invalid. Line 1, position 1. - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 475d06bd-18db-4cb8-95ab-e32b7fb423ea - Url: https://fef.fxpasu01.manage.microsoft.us/GroupPolicy/GroupPolicyAdminService/b15c97ad-ffff-6465-0807-100508342556/deviceManagement/groupPolicyUploadedDefinitionFiles?api-version=5018-11-06 - CustomApiErrorPhrase: ContentParsingException Exception: The remote server returned an error: (400) Bad Request.

Any thoughts?

Hello!

Same issue as 124?

Looks like Microsoft is changing a few things in the background so it has stopped working a couple of times.

Can you try the updated file?

EndpointManager.zip

Cheers!

Hello,

The photo error is just the script trying to download your photo for the login info. That is expected if you don't have one.

Can you attach the full log?

So you have 10 json in the folder with admx/adml files and only 5 uploaded. Can you zip the json and admx/adml file and attach as well?

So you are having issues with the actual admx/adml upload and not policy upload?

Cheers!

Hello,

I've started looking at this. I can replicate the issue whit the import of admx/adml.

The Windows Administrative Templates.json fails to import because it does not have the required information in it. Microsoft changed something a while back which broke the functionality. The ID of each setting is unique for each environment so it does not support migration between environments by default. The script will add additional information in the json files so that it can find the settings in the destination environment. This information is not available in the json. You will need to re-export the policy with the latest code (attached earlier). You should have "#Presentation_ID" properties in the json for this to work.

I'll try to get some time to look at the import of admx/adml soon.

Cheers!

Hello,

I found the issue. These admx/adml files are stored as UTF8. That caused the script to fail during the import.

I've fixed it and it will be included in the next release. I'm doing the last testing for it now.

Cheers!

Hello,

I just released 3.9.2. I did an export and I got the additional information in the json files so this should work now.

Let me know how it goes.

Cheers!

Hi,

This does still not appear to be working for me unfortunately. I brought down the whole new 3.9.2 package and ran that to open Intune manager (see attached about info screenshot), then exported windows the windowsadministrativetemplates.json file and attempted to import it into another tenant that already had the 10 ADMX files imported, it still only imported a partial amount of the configurations that are configured within windowsadministrativetemplates.json. It provided many instances of the same error in the log: "Failed to invoke MS Graph with URL https://graph.microsoft.us/beta/deviceManagement/groupPolicyConfigurations/80e24519-3e6a-4d11-bbce-3a39a5464bbc/definitionValues (Request ID: 4de2f687-7ff9-4eb1-bfba-78e390e573c7). Status code: NotFound. Response message: . Response message: An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 332691f6-54f1-45eb-b286-fd6e9f33abd4 - Url: https://fef.fxpasu01.manage.microsoft.us/GroupPolicy/GroupPolicyAdminService/b15c97ad-ffff-4233-1005-101700303213/deviceManagement/groupPolicyConfigurations('80e24519-3e6a-4d11-bbce-3a39a5464bbc')/definitionValues?api-version=5018-11-06 Exception: The remote server returned an error: (404) Not Found."

Additionally, the windowsadministrativetemplates.json does not appear to have any mention of "presentation_id" like you mentioned in an earlier post. I've attached the about info and the windowsadministrativetemplates.json that I exported using 3.9.2.

Good news is the ADMX import via Intune Manager is working with all 10 ADMX files now.

about -intunemanager

Windows Administrative Templates.json

Hello,

Thank you for the json! I finally understand what the issue is. You have a mixed policy eg based on built-in settings and imported admx settings. I had no idea that was even an option. I manged to create one of these and export/import it in the same tenant. I did get the extra properties in the json.
Note: I did NOT try export/import between environments.

Can you try this and let me know how it goes?

Cheers!

EndpointManager.zip

@Micke-K I spoke too soon. It only works in some tenants and not others. The 10 ADMX files import just fine, but then the administrative templates device configuration profile imports into some tenants with all custom and built in settings, but in others only the built in settings import and the Intune manager log shows various errors that state "Could not find presentation for setting . Setting will not be configured." I even made sure to wait until I see the 10 ADMX files show successfully imported before even attempting the administrative template configuration import.

Hello!

Thank you for testing and coming back with results.

So it fully work in some environments and fail in others. That is a bit strange. Can you attach a log from one of them. I might have to add some additional logging to see what is happening. I'll see if I can fix that on the weekend.

Cheers!

Unsuccessful import of administrative templates json with built in and custom settings (only built in settings import successfully)
Successful import of administrative templates json with built in and custom settings

@Micke-K I have attached two screenshots of Intune Manager logs. One showing logs during a successful upload if the administrativetemplates.json with both built in and custom settings successfully importing. The other screenshot shows logs from an unsuccessful import (the built-in settings import but the custom do not). These are both GCC High tenants. Please let me know what else I can do to assist the troubleshooting. Thanks!

Hello, @mike16329,

Do you swap tenants between imports? Does it work to import if you restart the app?

I cache the list of custom admx policies but I didn't clear the cache after swapping tenants or imported admx files. This will cause it to fail if importing to multiple tenants without restarting the app.

I'll fix this in the next version.

Cheers!

Hi @Micke-K it appears to be exactly that. I was not restarting the Intune Manager app between imports. I just restarted it and imported 100% successfully into a completely new test tenant. Good to know, thanks!

This should be fixed in the latest version. Let me know if you still have any issues.

Cheers!