Skip to content

Instantly share code, notes, and snippets.

@dallin
Created April 12, 2023 19:40
Show Gist options
  • Save dallin/a53ba796ad16da9e7d2e5ccc65c6f9c4 to your computer and use it in GitHub Desktop.
Save dallin/a53ba796ad16da9e7d2e5ccc65c6f9c4 to your computer and use it in GitHub Desktop.
Remote wipe a Windows 10/11 device
$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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment