jseerden/IntuneBackupAndRestore

Unable to restore policies

SAYANKO opened this issue · 2 comments

_Hello,
As long as the backup is working fine, I am not able to restore a policy.
Whenever I try to restore a single policy or more than one, I get the error "Error retrieving Intune Compliance Policy for C:\Temp\Device Compliance Policies\Assignments\DemoRecovery.json. Skipping assignment restore "
Remark: I get the same behavior for all types of policies that have been backed up.
I am using the modules:
Script 2.1.1 IntuneBackupAndRestore
Binary 6.1907.1.0 Microsoft.Graph.Intune

Has anyone had this problem as well?
Thank you_

Hi @SAYANKO

It seems you are trying to restore Assignments to policies that do not (yet) exist or have not been restored.

For example, when restoring Intune Compliance Policies and Assignments. Restore the Policies first, before restoring the Assignments.

For example: Run Start-IntuneRestoreConfig before Start-IntuneRestoreAssignments. Or run Invoke-IntuneRestoreDeviceCompliancePolicy before Invoke-IntuneRestoreDeviceCompliancePolicyAssignment

__Hello,
Thank you for your reply.
I tried both, Start-IntuneRestoreConfig then Start-IntuneRestoreAssignments or running the dedicated invoke request. The json file is listed in the folder and as explained in the process I only kept one.
image
image

Thanks