Comparing Intune Security Baseline settings

I work as System Administrator for more than 15 years now and I love to make my life easier by automating work & personal stuff via PowerShell (even silly things like food recipes list generation).
Search for a command to run...

I work as System Administrator for more than 15 years now and I love to make my life easier by automating work & personal stuff via PowerShell (even silly things like food recipes list generation).
No comments yet. Be the first to comment.
Or any other Azure service requiring special authentication strength

If you are using Azure Local (HCI), you might find the following PowerShell script AzureLocalVMImageUpdater.ps1 useful. What is it good for? The code replaces the Windows VM images in the specified Azure Local cluster(s) with the latest compatible ve...

Problem It happens that the hardware hash of your Autopilot device gets changed. Thanks to the replacement of the motherboard or some other issue. This can lead to future problems when your users need to reinstall the operating system, but the Autopi...

Learn how to use undocumented Azure APIs for massive performance gains

Keeping a secure, version-controlled backup of your Intune-managed device data, including BitLocker, LAPS, and FileVault keys, is a best practice for any modern IT team. In this post, I’ll guide you through an Azure DevOps pipeline that automates the...

I've released a new PowerShell function called Compare-IntuneSecurityBaseline in my IntuneStuff module.
This function allows you to easily identify the differences in settings between two Intune Security baselines. For instance, when Microsoft introduces a new Security Baseline for Windows 10, you can quickly see how it varies from your currently deployed baseline.
Install-Module IntuneStuff
Connect-MgGraph -Scope DeviceManagementConfiguration.Read.All
Compare-IntuneSecurityBaseline
When you invoke Compare-IntuneSecurityBaseline, you will be interactively asked to select the baseline type.

And then select two baselines of such type to compare.

Function exports both baselines as JSON objects and makes the comparison.
The result will be objects that look like this 👇

What do the object columns contain
Result - type of change (whether the setting differs or is missing completely)
Setting - name of the setting as is in the exported JSON file
device_vendor_msft_policy_config_defender_submitsamplesconsent search the GUI for ‘samples’ or ‘consent’).OldBslnValue - JSON value of the first baseline setting
NewBslnValue - JSON value of the second baseline setting
With the function Compare-IntuneSecurityBaseline in place, we can now easily compare our current baselines with their newly released versions. Such information can help to decide which settings need to be modified to avoid breaking our environment etc 🙂