Since publishing the Intune GitHub sample script repository (repo) containing PowerShell scripts that demonstrate the use of the Microsoft Graph API for automation in 2016, there have been significant changes to the Microsoft Graph and PowerShell modules. To ensure the scripts remain relevant and useful for the community, we have reviewed and updated a subset of the scripts and simplified code. In addition, new GitHub repos have been created to house the updated scripts based on the scenario type.
Important: From a support perspective, Microsoft fully supports Intune and its ability to deploy PowerShell scripts. However, Microsoft does not support the scripts themselves, even if they are on our GitHub repository. They’re provided for example only. You are responsible for anything that they may do within your environment. Always test!
Starting today, the original Intune Graph Samples repo is being archived, however it’ll remain available for educational purposes and may continue to be used to provide examples on how to interact with Microsoft Graph endpoints directly.
The goal of the new repositories is to provide PowerShell scripts that can be used to automate common tasks in Intune using the Microsoft Graph and Microsoft Graph PowerShell modules. These scripts are intended to help Intune administrators better understand how to utilize the Graph and PowerShell modules for automation. However, it’s up to each organization to use these scripts as a starting point to develop their own automation scripts that they will own and maintain.
Note: With the theme of simplification, the samples do not have code for authentication, which means the newly updated scripts repo will need to be edited and modified before they can be run. Each sample script includes the necessary comments that will guide you through the process of adding the code for authentication. To learn more, see Using Microsoft Graph PowerShell authentication commands.
The new Intune GitHub repos are structured for quick access based on scenario as follows:
Microsoft Graph PowerShell SDK Intune Samples – NEW!
Updated Intune management scripts with modern PowerShell functions.
Sample Shell solutions for Linux and macOS – unchanged
Shell script samples compatible with Linux and macOS.
Sample Intune solutions – NEW!
Automation scripts to perform actions related to a specific task or scenario.
Intune sample scripts – archive
Legacy Intune script samples.
We’ve also published a landing page to help locate each GitHub repo created and managed by our team located at: https://aka.ms/IntuneScripts.
Additional script samples will continue to be updated and added in the future, however if you have any suggestions for changes, updates, or ideas for new samples, please feel free to share them in the comments below or reach out to us on Twitter @IntuneSuppTeam. This project is for the Intune community and we want to ensure that it meets the needs and expectations of everyone. Thank you for your contribution and support.