PowerShell script to wipe\reset windows modern devices without user interaction

Sreekanth N Kartha 20 Reputation points
2025-01-17T07:22:34.65+00:00

I attempted to reset a modern Windows device using various PowerShell scripts at different permission levels, including silent mode. However, a prompt still appears during the process. Is there a PowerShell script available that can wipe the device's data without any user interaction?

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,762 questions
{count} votes

Accepted answer
  1. Gopika Lakshmi 85 Reputation points
    2025-01-21T10:45:08.3066667+00:00
    $namespaceName = "root\cimv2\mdm\dmmap"
    $className = "MDM_RemoteWipe"
    $methodName = "doWipeMethod"
    $session = New-CimSession
    $params = New-Object Microsoft.Management.Infrastructure.CimMethodParametersCollection
    $param = [Microsoft.Management.Infrastructure.CimMethodParameter]::Create("param", "", "String", "In")
    $params.Add($param)
    $instance = Get-CimInstance -Namespace $namespaceName -ClassName $className -Filter "ParentID='./Vendor/MSFT' and InstanceID='RemoteWipe'"
    $session.InvokeMethod($namespaceName, $instance, $methodName, $params)   
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.