Intune scripts

All the PowerShell scripts I share on PhotoITPro live in one public GitHub repo, free to use and change. Each one has a short header explaining what it does.

View the repo on GitHub

Before you use anything

Test every script on a pilot device or group first. Scripts are shared as they are, with no warranty, under the MIT licence.

Detection (1)

Detection

Detect-AppByRegistryVersion

Win32 app detection script: checks an installed app's version via the Uninstall registry keys.

Win32-Apps/Detection/Detect-AppByRegistryVersion.ps1

Requirement (1)

Requirement

Require-MinFreeDiskSpace

Win32 app requirement rule: the device must have enough free space on C: before the app installs.

Win32-Apps/Requirement/Require-MinFreeDiskSpace.ps1

Remediation (1)

Utility (4)

Utility

Get-AutopilotHardwareHash

Collects the Autopilot hardware hash from the local device and saves it as a CSV, ready to import into Intune. No extra modules needed.

Autopilot/Get-AutopilotHardwareHash.ps1

Utility

Get-SlowPCReport

Read-only slow PC diagnostics for Surface (Intel) laptops on Windows 10/11. Produces an HTML report with RED/AMBER/GREEN findings, plus raw CSV exports.

Diagnostics/Get-SlowPCReport.ps1

Utility

Write-Log

A simple timestamped logging helper. Dot-source it into your own scripts.

Utilities/Write-Log.ps1

Spotted a bug or have an idea? Open an issue on GitHub and I'll take a look. All scripts are shared under the MIT licence.