This post is about creating an Intune backup to a storage account Pt.3. You could use this to create a daily backup or even more frequent.

The clarify the above. I created a script that creates a backup from your Intune environment and uploads it to a storage account.

The last step is to send a notification about the changes that have been made between the latest 2 backups. We do so by sending mail via the Graph API.

Other parts:

Intune Backup to Storage Account Pt.1 – The Script

Intune Backup to Storage Account Pt.2 – The Automation Account

Prerequisites

Complete the other parts of this series:

Intune Backup to Storage Account Pt.1 – The Script

Intune Backup to Storage Account Pt.2 – The Automation Account

After that, you are ready to start this blog!

Add permissions to Service Principal

The Service Principal needs extra API permissions to be able to send an e-mail via Graph.

Firstly, log on to Microsoft Azure.

After that, go to your Service Principal you created in the first part of this series. Add the following permissions:

Intune Backup to Storage Account Pt.3 - Add permissions

Add these permissions:

Intune Backup to Storage Account Pt.3 - Add permissions 2

Lastly, consent the permissions:

Intune Backup to Storage Account Pt.3 - Consent

Add a new runbook for the notification

The notification that is sent via mail is sent via Graph. I have put this in a Powershell script which downloads the blobs from the Azure Storage Account, then compares the files, notes the changes and after that sends the changes via mail.

So, go to your Automation Account which you created in the second part of this series.

After that, create a new runbook:

Intune Backup to Storage Account Pt.3 - Create Runbook

Set the variables:

I have published the script on my Github account. You can find it here.

After that, change these parameters accordingly:

Running the RunBook

Lastly, we run the runbook to create the e-mail notification. Click on run:

After that, the blobs are downloaded from the storage account:

The comparison is done:

And that is then send via mail:

Intune Backup to Storage Account Pt.3 - E-mail Message

References

Send mail message via Graph

2 thoughts on “Intune Backup to Storage Account Pt.3 – The Notification”
  1. […] This post is about creating an Intune backup to a storage account. You could use this to create a daily backup or even more frequent. The clarify the above. I created a script that creates a backup from your Intune environment and uploads it to a storage account.I got a couple of requests to update a previous blog to remove the on-prem requirement. So, here we go!Other parts:Intune Backup to Storage Account Pt.2 – The Automation AccountIntune Backup to Storage Account Pt.3 – The Notification […]

  2. […] This post is about creating an Intune backup to a storage account Pt.2. You could use this to create a daily backup or even more frequent. The clarify the above. I created a script that creates a backup from your Intune environment and uploads it to a storage account.This part is about running the script in an Azure Automation Account. This enables the option to schedule your Intune Backup! Let’s go!Other parts:Intune Backup to Storage Account Pt.1 – The ScriptIntune Backup to Storage Account Pt.3 – The Notification […]

Leave a Reply

Your email address will not be published.