Files
asg/MDM-Enrollment.ps1
T

23 lines
707 B
PowerShell
Executable File

#!powershell
'''
Created: 2025-01-13
Modified: 2025-01-15
Description: This script will enroll the device into MDM.
'''
Write-Host -ForegroundColor Red "WARNING: This script will enroll the current device into MDM. This is meant for Add Source Group owned devices only. Do you want to continue? (Y/N)"
$answer = Read-Host
if ($answer -ne "Y") {
Write-Output "Exiting script - Device will not be enrolled into MDM"
exit
}
Write-Output "Enrolling device into MDM"
Start-Process -FilePath 'C:\Windows\system32\deviceenroller.exe' -ArgumentList '/c /AutoEnrollMDM'
Write-Host -ForegroundColor Green "Device enrolled script has completed. You can now close this window."