This repository provides a set of PowerShell scripts and an optional graphical launcher to streamline the process of onboarding Windows devices into Intune via Windows Autopilot.
It is designed for IT engineers to prepare corporate laptops for new hires, ensuring that each device is registered in Autopilot and ready for automatic configuration on first boot.
- You’ve received a new Windows device (or reset one).
- Before handing it to the end user, you want to:
- Register it in Autopilot.
- Assign it to the correct Azure AD group.
- Ensure it pulls the correct deployment profile during first setup.
When a new device is powered on:
-
Language selection screen appears.
-
Press Shift + F10 to open Command Prompt.
-
Type
powershell
to switch into PowerShell mode. -
Navigate to the folder containing these scripts (e.g., USB or Desktop):
D: # Or E: or any other removable drive
To see all drives:
diskpart list volume exit
For ease of use, launch:
.\gui_launcher.ps1
This provides a graphical menu where you can click buttons to run each script. Useful for helpdesk staff or batch registrations.
If script execution is blocked:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
This allows script execution only in the current PowerShell window.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
This persists across sessions but may not comply with your organization’s policy.
Registers the device with Autopilot using hardware hash.
🔧 Make sure you're signed into a tenant with permissions to register devices.
Checks if the device is already registered in Autopilot.
Assigns the current device to an Azure AD group (used for profile targeting).
🛠️ You must edit this script to include your Group Object ID:
$GroupId = "<YOUR_GROUP_OBJECT_ID>"
Find this in Azure AD → Groups → Properties → Object ID.
Displays the Azure AD groups the current device is a member of.
Confirms if a deployment profile is assigned to this device.
Optional script for executing PowerShell content from a GitHub Gist (advanced use).
Sample utility to identify USB drives automatically (used in older USB-based flows).
You can test all scripts locally on a VM or device before production use. Ensure the device is Azure AD-joined or hybrid-joined for full results.
Feel free to fork and submit improvements:
- Add logging
- Auto-fetch Group Object IDs
- Export results to CSV
Use these scripts only in authorized environments. Make sure you have the necessary permissions to register devices and assign them to groups in Azure.