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

Go ahead..Say something

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s