A collection of PowerShell scripts and configuration files for managing Microsoft Intune,
Entra ID, and Windows endpoints. Scripts are organized by feature/topic so related
content lives together regardless of where it runs (interactive, Azure Automation, or Azure Functions).
| Folder |
Purpose |
| PrimaryUser/ |
Manage the Intune device primary user (set, update, remove) across hosting models |
| DeviceConfiguration/ |
Export/import device configuration and Settings Catalog policies |
| AppLocker/ |
Create, update, and remove AppLocker EXE rules via the MDM WMI Bridge |
| WindowsLAPS/ |
Detection and remediation scripts for a custom local admin account |
| RBAC/ |
Intune role-based access control (scope tags) |
| Authentication/ |
Microsoft Graph authentication examples |
| Enrollment/ |
Intune enrollment configuration (incl. Azure China AVD) |
| Kiosk/ |
Assigned Access / kiosk configuration and auto-logon |
| SecurityBaseline/ |
Exported Intune security baseline definitions |
| Firewall/ |
Windows Firewall rule reporting |
| IntuneNetwork/ |
Network connectivity diagnostics for Intune / Windows Autopatch |
| Reference/ |
Reference data (Windows version-to-build lookup) |
| Script |
Description |
| Detect-LocalAdminLAPS.ps1 |
Detection script: verifies the custom local admin exists, is enabled, and is not a renamed built-in admin |
| New-LocalAdminLAPS.ps1 |
Remediation script: creates a local admin account with a randomized password |
| Script |
Description |
| Add-ScopeTag.ps1 |
Assigns an Intune RBAC Role Scope Tag by name |
| Script |
Description |
| Get-FirewallRules.ps1 |
Reports the enabled Windows Firewall rules enforced for the active network profile |
| Script |
Description |
| Test-AutopatchDiagnosticDataConnectivity.ps1 |
Diagnoses the Windows Autopatch "diagnostic data connectivity" device readiness failure by validating on-device prerequisites and endpoints (region-aware, with optional TLS-inspection detection, DNS-cache endpoint discovery, real HTTPS POST app-layer testing, and DiagTrack Event ID 29 log analysis). See the folder README. |
- Scripts use placeholders such as
<YourTenant>, <YourAppId>, and <YourAppSecret>.
Replace these with your own values, and prefer Azure Automation variables, Key Vault, or a
managed identity over hardcoding secrets.
- Most scripts require Microsoft Graph permissions. Review the comment-based help at the top
of each script for module and permission requirements.
Licensed under the MIT license. Please credit the original authors if you find these scripts useful.