This PowerShell script automates the execution of the Windows 11 Installation Assistant to silently upgrade devices to Windows 11. It is designed for seamless deployment with an MDM solution like SOTI MobiControl, enabling bulk upgrades across multiple devices while ensuring proper logging and error handling. The script is also compatible with manual execution using Task Scheduler or PowerShell.
Organizations face challenges upgrading devices to Windows 11 at scale:
- Time-Consuming: Manual upgrades require significant effort.
- Compatibility Concerns: Ensuring hardware compatibility across devices.
- End-User Disruption: Minimizing interruptions to user workflows.
- Automation Needs: Leveraging MDM solutions to push upgrades remotely.
- Streamlined Process: Automates the upgrade workflow using the Windows 11 Installation Assistant.
- Reduced Manual Effort: Deploy and execute scripts via SOTI or Task Scheduler.
- Centralized Logging: Provides clear logs for troubleshooting issues.
- Windows 11 Hardware Compatibility: Ensure devices meet Windows 11 system requirements.
- Installation Assistant: Place
Windows11InstallationAssistant.exeatC:\Users\Public\Downloads. The script will launch it from that path. - PowerShell Execution Policy: Use the following to bypass restrictions if needed:
powershell.exe -ExecutionPolicy Bypass -File "C:\Users\Public\Downloads\Launch_Win11_Assistant.ps1"
- Push
Windows11InstallationAssistant.exeto:C:\Users\Public\Downloads
- Save your script as
Launch_Win11_Assistant.ps1 - Deploy it to:
C:\Users\Public\Downloads
Use this PowerShell command in the SOTI script console to execute the upgrade script immediately:
Start-Process powershell.exe -ArgumentList "-ExecutionPolicy Bypass -File `\"C:\Users\Public\Downloads\Launch_Win11_Assistant.ps1`\"" -WindowStyle Hidden -Verb RunAsThis ensures the script runs with elevated privileges, even in a user session.
# === Windows 11 Upgrade via Installation Assistant ===
$AssistantPath = "C:\Users\Public\Downloads\Windows11InstallationAssistant.exe"
$CustomLogFile = "C:\ProgramData\Windows11_Upgrade_CustomLog.txt"
$TranscriptFile = "C:\ProgramData\Windows11_Upgrade_Transcript.txt"
Start-Transcript -Path $TranscriptFile -Append
function LogMessage {
param([string]$Message)
$TimeStamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$LogEntry = "$TimeStamp - $Message"
Write-Output $LogEntry
Add-Content -Path $CustomLogFile -Value $LogEntry
}
LogMessage "=== Starting Windows 11 Upgrade Process ==="
if (Test-Path $AssistantPath) {
LogMessage "Windows 11 Installation Assistant found at: $AssistantPath"
try {
LogMessage "Starting the Installation Assistant in quiet mode..."
$process = Start-Process -FilePath $AssistantPath `
-ArgumentList "/quietinstall", "/SkipEULA", "/SkipCompatCheck" `
-NoNewWindow -PassThru -Wait
if ($process.ExitCode -eq 0) {
LogMessage "Windows 11 Installation process completed successfully."
} else {
LogMessage "Windows 11 Installation process completed with exit code: $($process.ExitCode)"
}
} catch {
LogMessage "Error while running Windows 11 Installation Assistant: $_"
}
} else {
LogMessage "Error: Windows 11 Installation Assistant not found at: $AssistantPath"
}
LogMessage "=== Script execution finished ==="
Stop-Transcript-
Place both:
Windows11InstallationAssistant.exeLaunch_Win11_Assistant.ps1inC:\Users\Public\Downloads
-
Open PowerShell as Administrator
-
Run:
powershell.exe -ExecutionPolicy Bypass -File "C:\Users\Public\Downloads\Launch_Win11_Assistant.ps1"
- Transcript:
C:\ProgramData\Windows11_Upgrade_Transcript.txt - Custom log:
C:\ProgramData\Windows11_Upgrade_CustomLog.txt
Contributions are welcome! Please open issues or PRs with improvements, fixes, or enhancements.