smsagent.blog
  • docs.smsagent.blog
  • Custom Reporting in Microsoft Intune
    • Delivery Optimization Report
    • Windows Update for Business Custom Reporting
      • Power BI Report Walkthrough
      • Known issues / limitations
      • Change log
      • Deploy the solution
        • Create Azure Resources
        • Configure Azure Resources
        • Deploy the client-side script
        • Deploy the Azure automation runbooks
        • Configure the Power BI report
      • Adding additional language support
      • Table schema reference
    • Automating Data Exports from Microsoft Graph
      • Azure Automation account
        • Create / configure an Azure automation account
        • Grant API permissions
        • Create an Azure automation runbook
      • Azure Storage account
      • Automate Data Export to Azure Storage Account
      • Automate Data Export to Azure Monitor Logs
      • Creating / Troubleshooting Runbooks
      • Power BI
        • Connect Power BI to an Azure storage account data source
        • Connect Power BI to an Azure log analytics workspace as a data source
    • Managed Devices Report
      • Create / configure an Azure automation account
      • Grant API permissions
      • Create / configure an Azure storage account
      • Create an Azure automation runbook
      • Create a PowerBI report
      • MEM Managed Device Report template
      • Bonus! Unhealthy MEMCM Clients email report
    • Intune Assignments Report
      • Create / configure an Azure automation account
      • Grant API permissions
      • Create / configure an Azure storage account
      • Create an Azure automation runbook
      • Create a Power BI report
      • Change log
    • Patch My PC Report
      • A look at the Power BI reports
      • Change log
      • Video guides
      • Things to know
      • Create / configure an Azure automation account
      • Grant API permissions
      • Create / configure an Azure storage account
      • Create an Azure automation runbook
      • Create the Power BI report
      • Feedback
    • Windows 11 Hardware Readiness Report
    • Gathering Custom Inventory with Intune
      • Set up the Azure Resources
      • Create a Proactive remediations script package
      • Create a runbook
  • PowerShell Scripts Online Help
    • Get-AzSubscriptionActivityLog
  • Azure Solutions
    • Automated Azure Table Storage Backups
      • Change log
      • Deploy the solution
        • Create the Azure resources
        • Set the backup schedule
        • Add storage tables to the backup
        • Add role assignments to the storage account/s
        • Create a lifecycle management rule
      • Run a manual backup
      • Restore a backup
Powered by GitBook
On this page
  • PowerShell Modules
  • Prepare the Runbook
  • Create a Runbook
  • Schedule the Runbook

Was this helpful?

  1. Custom Reporting in Microsoft Intune
  2. Intune Assignments Report

Create an Azure automation runbook

Here we will create a runbook in the automation account that will retrieve data from Microsoft Graph using the REST API and export the data to the Azure storage account.

PreviousCreate / configure an Azure storage accountNextCreate a Power BI report

Last updated 1 year ago

Was this helpful?

PowerShell Modules

A couple of PowerShell modules are needed. If you are using the latest PowerShell runtime environment (7.2 at the time of writing), these modules should already be present and there should be no reason to create your own runtime environment. If you are using your own runtime environment, make sure the following modules are present and up-to-date.

  • Az.Accounts

  • Az.Storage

Prepare the Runbook

Download the automation runbook script from here:

In the Variables section near the top of the script, set values for the following variables:

  • ResourceGroup. The name of the Resource group that hosts the Azure storage account.

  • StorageAccount. The name of the Storage account.

  • Container. The name of the container you created.

Create a Runbook

  • Click on the Runbooks pane and choose Create a runbook.

  • Choose Browse for file and select the runbook script you downloaded.

  • Select the latest runtime environment (eg 7.2 at time of writing).

  • Click Review + Create.

  • When ready, Publish the runbook.

Schedule the Runbook

Schedule the Runbook to execute at regular intervals to keep the data updated, every 3 hours for example.

  • In the Azure portal, in the automation account, open the Runbook you created

  • Click Link to schedule

  • In the Schedule section, select an existing schedule or create a new one

https://github.com/SMSAgentSoftware/IntuneAssignmentsReport/blob/main/Export-MSIntuneAssignments.ps1