powershell-intune-samples icon indicating copy to clipboard operation
powershell-intune-samples copied to clipboard

CompliancePolicy_Export.ps1 does not include "Actions for noncompliance"

Open frazhamid opened this issue 5 years ago • 2 comments

When running CompliancePolicy_Export.ps1, the resultant csv and json do not include the "Actions for noncompliance" schedule.

frazhamid avatar Oct 12 '20 13:10 frazhamid

Hi @frazhamid,

The import from json script includes the default actions for non-compliance. The main reason for export not including the actions is that if there is an email template used to send emails when you import that to a different tenant then the import won't be able to find the email template id as it doesn't exist.

Are you export and importing into the same tenant?

Dave

davefalkus avatar Oct 12 '20 13:10 davefalkus

Hi @frazhamid,

The import from json script includes the default actions for non-compliance. The main reason for export not including the actions is that if there is an email template used to send emails when you import that to a different tenant then the import won't be able to find the email template id as it doesn't exist.

Are you export and importing into the same tenant?

Dave

Hi @davefalkus ,

Thanks for the super quick response. ps. Love the toolkit. Thank you for explaining the reason and can understand the constraint.

I do intend to export the policy and then import into a different tenant. The actions I was hoping I could capture in the json file were something like as follows:

    "scheduledActionsForRule":[
        {
            "ruleName":"PasswordRequired",
            "scheduledActionConfigurations":[
                {"actionType":"pushNotification","gracePeriodHours":0},
                {"actionType":"pushNotification","gracePeriodHours":15},
                {"actionType":"block","gracePeriodHours":30},
                {"actionType":"retire","gracePeriodHours":60}
            ]
        }
    ],

Do you know if these action types also require an email template?

frazhamid avatar Oct 12 '20 13:10 frazhamid