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.
![Screenshot of Windows 11 in Hyper-V](https://teams.se/wp-content/uploads/2023/02/image-4.png)
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.
![Screenshot of Windows 11 - Choose country](https://teams.se/wp-content/uploads/2023/02/image-5.png)
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.
![Screenshot of Autopilot login screen](https://teams.se/wp-content/uploads/2023/02/image-6.png)
You have to log in with an account that has the Intune Administrator Role and approve the Permission Request
![Screenshot of Autopilot Permission request](https://teams.se/wp-content/uploads/2023/02/image-7.png)
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
![Screenshot of Intune -> Devices -> Enrollment alerts](https://teams.se/wp-content/uploads/2023/02/image-8.png)
Here you will find one unassigned windows device.
Stay tune for next part 🎉