I've seen quite a few users struggling to update to Windows 11 through the update ring in Intune due to the error 'unable to update system reserved partition.' I've managed to manually run a series of commands as an administrator on two devices, but I'm looking for guidance on how to automate this process via a script push in Intune for those affected devices. Any suggestions would be greatly appreciated!
3 Answers
Here's a complete script example that might work for you:
```powershell
$fontsPath = "Z:EFIMicrosoftBootFonts"
# Mount EFI partition
$diskpartScript = @"
select disk 0
select partition 1
assign letter=Z
exit
"@
$scriptPath = "$env:TEMPdp_detect.txt"
$diskpartScript | Set-Content -Path $scriptPath -Encoding ASCII
Start-Process -FilePath "diskpart.exe" -ArgumentList "/s `"$scriptPath`"" -Wait -NoNewWindow
Start-Sleep -Seconds 2
# Check for font files
if (Test-Path $fontsPath -and (Get-ChildItem $fontsPath -File)) {
Write-Output "Font files exist. Remediation needed."
exit 1
} else {
Write-Output "No font files found. No remediation needed."
exit 0
}
```
This script mounts the EFI partition and checks for font files. If they’re found, remediation is needed!
For disk management, PowerShell has its own set of commands that you can use, which can be simpler than Diskpart. Here's a quick example of how to manage partitions safely:
```
Add-PartitionAccessPath -DiskNumber 0 -PartitionNumber 1 -AccessPath Z:
```
But make sure to find the actual system partition programmatically—don't assume Disk 0 and Partition 1 are always the right choice! You can use:
```
Get-Partition | Where-Object -Property IsSystem -EQ $true
```
This will help avoid risks of using the wrong partition!
You can use the `/s` parameter in Diskpart to execute a script file directly. The commands you've written can be easily translated. To get started, here’s a sample of how you can set it up:
```
@(
"List disk"
"sel disk 0"
"list part"
"sel part 1"
"assign letter=z"
) | diskpart.exe
```
This way, you’re sending commands to Diskpart as if you were typing them out manually!
I’m not too familiar with PowerShell. Can you help with translating those commands into a PowerShell script?
Thanks for the tip! I'll definitely use this safer approach.