Intune Remote Wipe: There was a problem resetting your PC

by | Sep 11, 2024 | Blog

This blog will discuss why relying solely on a remote wipe from Intune can be problematic, especially with Dell devices configured in RAID mode. We’ll explore the issue behind it and provide a solution to ensure a successful reset so you won’t end up with the “There was a problem resetting your PC” error.

Introduction to Remote Wipe

The remote wipe option is crucial in mobile device management (MDM) solutions like Microsoft Intune. It allows administrators to restore devices to factory settings, erasing all user data, apps, and configurations. This functionality is essential for protecting sensitive information when a device is lost, stolen, or retired from use.

How Remote Wipe Works

When a remote wipe command is initiated from the Intune / MDM console, it sends a remote wipe signal to the device over the internet.

Upon receiving the wipe command, the device performs a factory reset, restoring it to its original state. This ensures that any personal or corporate data on the device is permanently deleted. The whole flow is very easy. You don’t need to run to the device with your installation media to reinstall Windows on your own. It will all happen automatically! Isn’t that nice?

Why Perform a Remote Wipe?

Remote wipes are necessary in several scenarios, including:

  • Lost or Stolen Devices: To prevent unauthorized access to sensitive data.

  • Employee Offboarding: To remove corporate data from the devices of departing employees.

  • Device Repurposing: To prepare devices for new users by removing existing data and configurations.

  • Security Breaches: To quickly mitigate risks by wiping compromised devices.

For more information on how the Intune Remote Wipe works, feel free to read Microsoft documentation: Retire or wipe devices using Microsoft Intune | Microsoft Learn

There was a problem resetting your PC

While remote wipes are generally reliable, they can sometimes fail, especially on Dell Devices.  When the device reboots after the remote wipe is initiated from Intune, Windows should typically start reinstalling on your device. Sometimes, the reset will fail, and the device could end up on this startup repair screen. As shown below, there are a few troubleshooting options, except resetting your PC or turning it off.

After rebooting the device again, another error will appear: “There was a problem resetting your PC.”

The moment we receive this screen with the error message “There was a problem resetting your PC,” it’s obvious that the device hasn’t been wiped. Without the device being wiped, things could become bad. How do we proceed? Are we going to perform a system restore? Are we going to just reinstall Windows? Or will we take a closer look to prevent this from happening again?

You want to prevent this from happening because the moment you wipe the device, you will lose track of it. A common wipe issue with Dell devices is that they are shipped with default RAID (Intel Rapid Storage Technology) mode enabled instead of AHCI/NVMe.

Dell devices are shipped with RAID on by default to ensure the device has the highest performance.

Dell is mentioning that by default they are turning on RAID for performance reasons

This could lead to a big problem because If WinRE lacks the necessary RAID drivers, this can interfere with the wipe process. How are we going to fix this?

Disabling RAID in BIOS

A solution could be to disable RAID in the BIOS settings. This changes the storage configuration from RAID to AHCI, which is generally more compatible with standard drivers included in Windows. However, be aware that switching to AHCI may impact system performance. To disable RAID:

  1. Restart your computer and enter the BIOS setup (usually by pressing F2, F10, or Delete during boot).

  2. Navigate to the storage configuration section.

  3. Change the SATA operation mode from RAID to AHCI.

  4. Save the changes and exit the BIOS.

AHCI/NVMe Raid options. By default this is configured to RAID on. We could configure this to AHCI/NVME

Again, disabling RAID isn’t advised so, what’s left?  When we want to make sure that the device can be successfully wiped when the disk drives are in RAID mode, we can inject the drivers in the Windows Recovery Environment (WinRE)

The Fix: Injecting RAID Drivers with PowerShell

To resolve this nasty Remote Wipe issue, injecting the required RAID drivers into the Windows Recovery Environment (WinRE) can help the system recognize the RAID array during recovery so it doesn’t boot up in startup repair.

We can do so by using the  ReAgentC.exe /mountre command to inject the Intel Raid VST drivers into the Windows Recovery Environment

Here’s a simplified process using PowerShell:

# Define variables for driver name, mount directory, and driver directory
$DriverName = "iaStorVD.inf" # Dell Latitude 5XXX (Intel RST)
$MountDir = "$env:TEMP\WinRE"
$DriverDir = "$env:TEMP\WinRE_Driver"

# Start logging the script execution
Start-Transcript -Path $env:TEMP\WinRE.log

# Get the latest version of the storage driver
$StorageDriver = Get-WindowsDriver -Online -All |
    Where-Object { $_.Inbox -eq $False -and $_.BootCritical -eq $True -and $_.OriginalFileName -match $DriverName } |
    Sort-Object Version -Descending | Select-Object -First 1

 # Ensure there is a single driver of matching criteria before proceeding
If ($null -ne $StorageDriver -and $StorageDriver.Count -eq 1) {
    # Create the mount directory if it does not exist
    If (!(Test-Path -Path $MountDir)) {
        New-Item -Path $MountDir -ItemType Directory
    }
    # Create the export directory for the driver if it does not exist
    If (!(Test-Path -Path $DriverDir)) {
        New-Item -Path $DriverDir -ItemType Directory -Force
    }

    # Export the driver using pnputil
    pnputil.exe /export-driver $StorageDriver.Driver $DriverDir
    # Mount the Windows RE image, add the driver, and clean up the image
    ReAgentC.exe /mountre /path $MountDir
    dism /Image:$MountDir /Add-Driver /Driver:$DriverDir
    dism /Image:$MountDir /Cleanup-Image /StartComponentCleanup
    ReAgentc.exe /unmountre /path $MountDir /commit

    # Clean up directories
    Remove-Item -Path $DriverDir -Recurse
    Remove-Item -Path $MountDir
    exit 0
}

# Throw an error if there are multiple or no drivers found, indicating a need for manual intervention
Else {
    Write-Error "Invalid quantity of drivers detected. Expected value is 1."
    $StorageDriver
    Exit 1

}
# Stop logging the script execution
Stop-Transcript

When deploying this PowerShell script to your existing Dell devices, you no longer need to worry about whether the device will be appropriately wiped! With this PowerShell in place, you don’t need to go through the hassle of trying to do a startup repair to get the operating system back on track.

As shown below, the PowerShell script will export the installed driver on the device to a temp folder. After exporting the driver, it will add the driver to the WinRE.

With the RAID drivers injected into the WinRE, the device could boot, start performing the actual wipe, and start reinstalling Windows.

Conclusion

Remote wipe is an essential tool for device management, ensuring data security and device readiness. However, issues like Dell’s default RAID configuration can cause wipe failures. Administrators can ensure smooth and successful remote wipes by understanding these issues and implementing fixes, such as injecting drivers with PowerShell. Once the device has been wiped, you can rely on Patch My PC to make sure that all of your apps are reinstalled.