Lab · Intermediate · 45 min

Import a device into Windows Autopilot and assign a profile

Collect a hardware hash from a test virtual machine, import it, and confirm the profile is Assigned before resetting.

What you need

  • A test tenant with Intune
  • A Windows 11 virtual machine with a virtual TPM
  • Intune Administrator

Steps

  1. Collect the hash in the VM

    Run as administrator inside the VM.

    PowerShell
    Install-Script -Name Get-WindowsAutopilotInfo -Force
    Get-WindowsAutopilotInfo -OutputFile C:\Temp\vm-hash.csv
  2. Create a dynamic group

    Entra ID, Groups, New group, Dynamic device, rule on the group tag.

    PowerShell
    (device.devicePhysicalIds -any (_ -eq "[OrderID]:LAB"))
  3. Import the hash

    Intune, Devices, Windows, Enrollment, Devices, Import. Set the group tag LAB.

  4. Create and assign a profile

    Deployment profiles, Create profile, User-driven, Entra joined, assign to the dynamic group.

  5. Wait for Assigned, then reset

    When Profile status shows Assigned, reset the VM and sign in with a test user.

Check your result

The VM shows your company branding at setup and appears in Intune as compliant.

Microsoft documentation

Disclaimer. These samples are provided as is, without warranty of any kind. Read and test every script in a non-production tenant before you run it, and run reports before any command that changes or deletes data.