Skip to content
Microsoft 365 Admin - Intune and Endpoint

Microsoft Intune Part 3 – Enroll your Virtual Machine

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

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

The enrollment commands explained

PowerShell.exe -ExecutionPolicy Bypass
Install-Script -name Get-WindowsAutopilotInfo -Force
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
Get-WindowsAutopilotInfo -Online
  1. Start Powershell with an Execution policy to Bypass
  2. Install the script required to enroll the machine
  3. Set Excecution policy to let you run the script
  4. Start the Script

Read more on Microsoft Learn.

Screenshot of Autopilot login screen

You have to log in with an account that has the Intune Administrator Role and approve the Permission Request

Screenshot of Autopilot 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

Screenshot of Intune -> Devices -> Enrollment alerts

Here you will find one unassigned windows device.

Stay tune for next part 🎉

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.