Created
April 12, 2023 19:40
-
-
Save dallin/a53ba796ad16da9e7d2e5ccc65c6f9c4 to your computer and use it in GitHub Desktop.
Remote wipe a Windows 10/11 device
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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