-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautopilot.ps1
More file actions
30 lines (18 loc) · 1.04 KB
/
autopilot.ps1
File metadata and controls
30 lines (18 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Set-ExecutionPolicy Unrestricted
Install-Script -name Get-WindowsAutopilotInfo -Force
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
Get-WindowsAutoPilotInfo.ps1 -online -TenantID "" -Appid "" -appsecret "" -GroupTag
<################## MANUAL METHOD ###########################>
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Get the machine’s BIOS serial number
$serial = (Get-CimInstance -ClassName Win32_BIOS).SerialNumber.Trim()
New-Item -Type Directory -Path "C:\$serial HWID"
# Change location into the new folder
Set-Location -Path "C:\$serial HWID"
# Add Scripts folder to your PATH for this session
$env:Path += ";C:\Program Files\WindowsPowerShell\Scripts"
# Allow running downloaded scripts in this session
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force
# Install and run the Autopilot HWID extractor, outputting inside your serial-named folder
Install-Script -Name Get-WindowsAutopilotInfo -Force
Get-WindowsAutopilotInfo -OutputFile "AutopilotHWID.csv"