Micke-K / IntuneManagement

Copy, export, import, delete, document and compare policies and profiles in Intune and Azure with PowerShell script and WPF UI. Import ADMX files and registry settings with ADMX ingestion. View and edit PowerShell script.
MIT License
1.05k stars 186 forks source link

Downloading File not working #210

Open burak40 opened 5 months ago

burak40 commented 5 months ago

If I try to download application with file is not working.

Failed to invoke MS Graph with URL https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/62197dd5-22ba-46a3-ad28-254f7a866e9b/microsoft.graph.winGetApp/contentVersions//files (Request ID: 9b118abc-3a3a-4120-a9fe-c9123e7e4f97). Status code: BadRequest. Response message: Resource not found for the segment 'contentVersions'. Exception: The remote server returned an error: (400) Bad Request.

burak40 commented 5 months ago

Some extra information

image
Micke-K commented 5 months ago

Hello,

Is this during bulk export? If it is, then, it won't download the content unless the encryption file is available.

You have to save the encryption file during upload (in Settings) or use the stand-alone script to export it and save it in the download folder specified in Settings.

The app can get the encryption info since there's no API for it.

Cheers!

burak40 commented 4 months ago

Hi Mick,

It is not on bulk export, what I want to achieve is to export application .intunewin and import for an another customer.

How can I achieve this?

Micke-K commented 4 months ago

Hello,

I just noticed that the original error says winGetApp. Are you trying to download files for a business store app? That is not possible.

Cheers!

burak40 commented 4 months ago

Hi ,

I realized later this is not possible. Now I'm just trying to export .intunewin file and import for an another customer.

For example customer A has the following applications:

Google Chrome RMM Agent Dbforge Etc

These applications are uploaded in the portal as a intunewin file.

I want to export these intunewin files and import with exactly same configurerd parameters

Thanks in advance

Micke-K commented 4 months ago

Hello,

That is possible but it will require the encryption file. Without the encryption file, you can download it but it will be encrypted and useless.

You can only get the encryption file from the original .intunewin file and extract it with the Export-ExcryptionKeys.ps1 file in the Scripts folder.

Cheers!

burak40 commented 4 months ago

Hi,

I followed your suggestion and created some intunewin files locally. Then I ran export command to export encryption file. After running the script .json files are exported.

If i try to import it, its not working. What is the best steps to do it?

Micke-K commented 4 months ago

Hello,

Ah yes, there is a but for that. The download .intunewin file is just a zip file. You can rename to zip and extract it. The downloaded and decrypted.intunewin file cannot be used for upload. In requires the extract and repackage part. It is really annoying but it's the way Microsoft designed it.

Cheers!