Remotely Wipe workstation

Remotely Wipe workstation

Recently I needed a way to remotely wipe a machine, and we do not currently have any MDM licenses. So I found a quick powershell script that connected to the Windows 10+ WMI / MDM method and can do a factory reset with full wipe. 

I found the original article here which allowed me to remote wipe the machine. https://techcommunity.microsoft.com/t5/windows-deployment/factory-reset-windows-10-without-user-intervention/m-p/1339823#

More info
https://docs.microsoft.com/en-us/windows/win32/dmwmibridgeprov/mdm-remotewipe


  1. $namespaceName = "root\cimv2\mdm\dmmap"
  2. $className = "MDM_RemoteWipe"
  3. $methodName = "doWipeProtectedMethod"

  4. $session = New-CimSession

  5. $params = New-Object Microsoft.Management.Infrastructure.CimMethodParametersCollection
  6. $param = [Microsoft.Management.Infrastructure.CimMethodParameter]::Create("param", "", "String", "In")
  7. $params.Add($param)

  8. $instance = Get-CimInstance -Namespace $namespaceName -ClassName $className -Filter "ParentID='./Vendor/MSFT' and InstanceID='RemoteWipe'"
  9. $session.InvokeMethod($namespaceName, $instance, $methodName, $params)