remote wipe at next connection with SMA
Hi
We need to remote wipe a computer next time it connects to our network
is there a way or script i can use with the sma or sda
thansk
1 Comment
[ + ] Show comment
-
More information at the source https://docs.microsoft.com/en-us/windows/win32/dmwmibridgeprov/mdm-remotewipe - gwir 2 years ago
Answers (2)
Answer Summary:
Please log in to answer
Posted by:
gwir
2 years ago
Top Answer
You can try this shell script who initiate a factory reset
# Bascule de powershell en 64 bits
if ($PSHOME -like "*syswow64*") {
Write-Output 'Relaunching as x64'
& (Join-Path ($PSHOME -replace 'syswow64', 'sysnative') powershell.exe) `
-File $Script:MyInvocation.MyCommand.Path `
@args
Exit
}
# Debut du script
$namespaceName = "root\cimv2\mdm\dmmap"
$className = "MDM_RemoteWipe"
$methodName = "doWipeProtectedMethod"
$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)
Inspired by
Source https://techcommunity.microsoft.com/t5/windows-deployment/factory-reset-windows-10-without-user-intervention/m-p/1349038/highlight/true#M559
Comments:
-
Works great. Added it to my SMA and called it Doomsdayscript. - CarstenBuscher 2 years ago
-
Excellent! Thanks for the feedback ! - gwir 2 years ago
-
I would not consider this a true\proper clean or wipe, but it works - Channeler 2 years ago
-
The « doWipeProtectedMethod » also clean free space, and can not be interrupt. If you restart the computer the processe continue at next boot. - gwir 2 years ago