AutoPilot Script

I use this custom script to autopilot Intune enrolled devices. The hash file gets stored in a CSV file with GroupTag/OrderID needed.

#How to Ignore TPM requ in HyperV
REG ADD HKLM\SYSTEM\Setup\LabConfig /v BypassTPMCheck /t REG_DWORD /d 1
REG ADD HKLM\SYSTEM\Setup\LabConfig /v BypassSecureBootCheck /t REG_DWORD /d 1

#Manually Register device for autopilot
New-Item -Type Directory -Path "C:\HWID"
Set-Location -Path "C:\HWID"
$env:Path += ";C:\Program Files\WindowsPowerShell\Scripts"
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
Install-Script -Name Get-WindowsAutoPilotInfo
Get-WindowsAutoPilotInfo -OutputFile AutoPilotHWID.csv -GroupTag DeskEng

#While OOBE Running, you can upload it too
PowerShell.exe -ExecutionPolicy Bypass
Install-Script -name Get-WindowsAutopilotInfo -Force
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
Get-WindowsAutoPilotInfo -Online

#Troubleshooting & Exporting logs
mdmdiagnosticstool.exe -area DeviceProvisioning -cab C:\Log.CAB
net use Z: \\ServerName\SharedLocation$
Copy C:\Log.Cab Z:
#Copy that file from Z: to your local PC

#To View Log Files:
install-script -name get-autopilotdiagnostics -force
Get-AutopilotDiagnostics -CABFile C:\temp\Log.Cab

Rename file from .odt to .ps1