Hi Everyone,
A large request from my team was the ability to remote wipe machines. As we all know our remote work force is getting larger and sometimes it is hard to get an asset back. Below is a Worklet I created that will wipe a machine with no user interaction. Be CAREFUL and do not run this on your machine. Once it starts it will take a few seconds to run. I recommend creating a group called YourCompanyName - Tech Worklets or Remote Wipe. Then assign machines to the policy that you want to remotely wipe. I would then recommend removing them after a few minutes.
$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)