Category filter
Script to Wipe Windows Devices
Organizations may need to secure a lost, stolen or misplaced Windows device by performing a complete wipe on it. A complete wipe removes all the organizational and user data and apps, restoring the device to its factory defaults. Hexnode empowers organizations to execute the wipe action on Windows devices remotely with the help of custom scripts.
PowerShell Script to Wipe Windows devices
The PowerShell script to execute the wipe action on Windows devices is given below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
$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) try { $instance = Get-CimInstance -Namespace $namespaceName -ClassName $className -Filter "ParentID='./Vendor/MSFT' and InstanceID='RemoteWipe'" $session.InvokeMethod($namespaceName, $instance, $methodName, $params) } catch [Exception] { write-host $_ | out-string } |
The doWipeMethod
triggers the device to start the remote wipe.