It would appear that during the conversion of the policy objects to json, a lot of the property data is lost... resulting in either completely blank values or "null" values in the .json file that make the export less useful than hoped (and certainly not usable for re-import or making quick copies of policies).
This is an example, there is more missing. Because so much is missing, the Import script also doesn't work because it can't parse "nothing".
The Get-MgDeviceAppManagementiOSManagedAppProtection command is able to get all of the data on a policy, as using Format-List and some selective -ExpandProperty on a few of the Properties will show all of the data necessary. Example:
Hi @shimojimatto , thanks for filing this issue. I made a few improvements to both import and export scripts that should address this. Please re-open this issue if you encounter the same problem.
It would appear that during the conversion of the policy objects to json, a lot of the property data is lost... resulting in either completely blank values or "null" values in the .json file that make the export less useful than hoped (and certainly not usable for re-import or making quick copies of policies).
Example partial json output:
This is an example, there is more missing. Because so much is missing, the Import script also doesn't work because it can't parse "nothing". The Get-MgDeviceAppManagementiOSManagedAppProtection command is able to get all of the data on a policy, as using Format-List and some selective -ExpandProperty on a few of the Properties will show all of the data necessary. Example:
I'm not sure how the code can be improved to make a more useful output can anyone help?