Let’s enroll your virtual (or local) machine in Intune. Step by step with pictures.
Hyper-V and Win 11 Dev
In Part 1 we installed a virtual machine via Hyper-V. This is a Win 11 Development version and on first boot you get straight into windows.
First reset the virtual machine
Press the Windows Key and type “Reset” Choose to reset the pc, “Remove everything” and use “Local install”.
💡Remember save the state and name it “Fresh install” or similar in Hyper-V after the reset. This will make it easier to test it again.
Next we enroll it with Autopilot
This requires Powershell and 4 lines of code. Let’s examine it.
Make sure you have this screen up and press Shift + F10 to get the console window up.
The enrollment commands explained
PowerShell.exe -ExecutionPolicy Bypass
Install-Script -name Get-WindowsAutopilotInfo -Force
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
Get-WindowsAutopilotInfo -Online
- Start Powershell with an Execution policy to Bypass
- Install the script required to enroll the machine
- Set Excecution policy to let you run the script
- Start the Script
Read more on Microsoft Learn.
You have to log in with an account that has the Intune Administrator Role and approve the Permission Request
Now it will enroll the device, note that there will be a few “Waiting for 1 of 1 to be imported” before you get the “1 devices imported successfully“. In my case I had 6 of them.
Reboot the virtual machine with the command “shutdown /r /f /t 0”
For a local windows installation, the process is the same.
Find the device in Intune
Go to endpoint.microsoft.com ➡️ Devices ➡️ Enrollment alerts
Here you will find one unassigned windows device.
Stay tune for next part 🎉