Factory Reset Windows 10 without user intervention

%3CLINGO-SUB%20id%3D%22lingo-sub-1339823%22%20slang%3D%22en-US%22%3EFactory%20Reset%20Windows%2010%20without%20user%20intervention%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1339823%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20looked%20for%20this%20answer%20online%20and%20have%20come%20across%20the%20%22systemreset%20-factoryreset%22%20command%20which%20works%2C%20but%20it%20comes%20up%20with%20the%20prompt%20asking%20if%20I%20want%20to%20keep%20my%20files%20or%20remove%20everything%2C%20I%20want%20to%20remove%20everything%2C%20but%20without%20the%20prompt.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20not%20doing%20this%20from%20any%20pre-exiting%20images%2C%20and%20our%20laptops%20are%20running%20the%20pre-loaded%20Windows%2010%20Pro%20install%2C%20we%20are%20just%20using%20the%20in-built%20Windows%2010%20%22reset%20this%20PC%22%20feature%20as%20we%20have%20no%20MDM%20configured.%20We%20just%20want%20the%20laptops%20to%20be%20totally%20reset%20so%20they%20don't%20contain%20any%20company%20information%2C%20we're%20not%20bothered%20about%20completing%20the%20OOBE%20once%20they%20are%20wiped.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20trying%20to%20accomplish%20this%20remotely%20as%20our%20users%20are%20all%20at%20home%2C%20so%20I%20need%20to%20automate%20it%20and%20have%20no%20user%20involvement%20in%20the%20process%2C%20I%20just%20want%20it%20to%20factory%20reset%2C%20and%20bring%20the%20laptop%20up%20to%20the%20off-the-shelf%20state%20configuration.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20know%20if%20this%20is%20possible%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22%22%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1340646%22%20slang%3D%22en-US%22%3ERe%3A%20Factory%20Reset%20Windows%2010%20without%20user%20intervention%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1340646%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20%3CSTRONG%3Esystemreset%3C%2FSTRONG%3E%20command%20will%20show%20interface%20to%20user%20and%20it%20is%20behavior%20by%20design%20%2C%20however%20if%20you%20are%20able%20to%20manage%20devices%20using%20Configuration%20Manager%2C%20you%20could%20do%20it%20using%20Full%20Wipe%2C%20take%20a%20look%20at%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmem%2Fconfigmgr%2Fmdm%2Fdeploy-use%2Fwipe-lock-reset-devices%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmem%2Fconfigmgr%2Fmdm%2Fdeploy-use%2Fwipe-lock-reset-devices%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EYou%20could%20remotely%20wipe%20device%20using%20Windows%20Intune%20too%3A%3C%2FP%3E%0A%3CP%3E%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmem%2Fintune%2Fremote-actions%2Fdevices-wipe%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmem%2Fintune%2Fremote-actions%2Fdevices-wipe%3C%2FA%3E%3C%2FFONT%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1340726%22%20slang%3D%22en-US%22%3ERe%3A%20Factory%20Reset%20Windows%2010%20without%20user%20intervention%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1340726%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F13441%22%20target%3D%22_blank%22%3E%40Reza%20Ameri%3C%2FA%3E%26nbsp%3BThanks%20for%20your%20reply.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%20we%20do%20not%20use%20configuration%20manager%2C%20nor%20do%20we%20have%20capacity%20to%20register%20devices%20on%20InTune%20currently.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20can%20run%20exe's%2Fpowershell%20scripts%2C%20that%20sort%20of%20thing%20on%20the%20laptops%20so%20we're%20hoping%20to%20use%20something%20like%20that%20to%20achieve%20this.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1344690%22%20slang%3D%22en-US%22%3ERe%3A%20Factory%20Reset%20Windows%2010%20without%20user%20intervention%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1344690%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F637964%22%20target%3D%22_blank%22%3E%40Claire_4%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFrom%20what%20I%20know%20there%20is%20no%20script%20to%20run%20it%20in%20silence%20mode%20and%20wipe%20system%20and%20it%20is%20behavior%20by%20design%2C%20so%20let%20say%20if%20there%20is%20possibility%20to%20do%20so%2C%20cybercriminals%20might%20run%20that%20script%20and%20user%20will%20lose%20Windows%20but%20it%20is%20available%20in%20Configuration%20Manager%20or%20Intune%2C%20it%20means%20PC%20is%20being%20managed%20by%20trusted%20administrator.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1348679%22%20slang%3D%22en-US%22%3ERe%3A%20Factory%20Reset%20Windows%2010%20without%20user%20intervention%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1348679%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F637964%22%20target%3D%22_blank%22%3E%40Claire_4%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20the%20ability%20to%20pull%20down%20content%2C%20you%20can%20pull%20down%20Windows%201909%20Installer%2C%20then%20run%20the%20command%20to%20upgrade%20and%20clean%20the%20system.%26nbsp%3B%20The%20entire%20thing%20can%20be%20scripted.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-hardware%2Fmanufacture%2Fdesktop%2Fwindows-setup-command-line-options%23auto%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-hardware%2Fmanufacture%2Fdesktop%2Fwindows-setup-command-line-options%23auto%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1349038%22%20slang%3D%22en-US%22%3ERe%3A%20Factory%20Reset%20Windows%2010%20without%20user%20intervention%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1349038%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20use%20the%20MDM%20WMI%20Bridge%20Provider%20to%20do%20what%20you%20want.%20This%20way%20you%20do%20exactly%20the%20same%20as%20intune%20would%20do.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20have%20to%20execute%20the%20following%20PowerShell%20script%20as%20SYSTEM.%20Administrator%20ist%20not%20enough!%3C%2FP%3E%3CP%3ETo%20accomplish%20this%2C%20you%20can%20either%20execute%20the%20script%20with%20task%20scheduler%20or%20use%20psexec.exe%20to%20run%20powershell%20as%20system%20(psexec%20-s%20powershell.exe%20-file%20c%3A%5Cpathtoscript%5Cscript.ps1).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24namespaceName%20%3D%20%22root%5Ccimv2%5Cmdm%5Cdmmap%22%0A%24className%20%3D%20%22MDM_RemoteWipe%22%0A%24methodName%20%3D%20%22doWipeMethod%22%0A%0A%24session%20%3D%20New-CimSession%0A%0A%24params%20%3D%20New-Object%20Microsoft.Management.Infrastructure.CimMethodParametersCollection%0A%24param%20%3D%20%5BMicrosoft.Management.Infrastructure.CimMethodParameter%5D%3A%3ACreate(%22param%22%2C%20%22%22%2C%20%22String%22%2C%20%22In%22)%0A%24params.Add(%24param)%0A%0A%24instance%20%3D%20Get-CimInstance%20-Namespace%20%24namespaceName%20-ClassName%20%24className%20-Filter%20%22ParentID%3D'.%2FVendor%2FMSFT'%20and%20InstanceID%3D'RemoteWipe'%22%0A%24session.InvokeMethod(%24namespaceName%2C%20%24instance%2C%20%24methodName%2C%20%24params)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24methodname%20can%20bei%20either%20%22doWipeMethod%22%20or%20%22doWipeProtectedMethod%22.%20The%20later%20one%20will%20also%20wipe%20all%20data%20from%20the%20disks%2C%20especially%20if%20you%20want%20to%20refurbish%20the%20devices.%20The%20downside%20is%20that%20%22doWipeProtectedMethod%22%20can%20leave%20some%20clients%20(depending%20on%20configuration%20and%20hardware)%20in%20an%20unbootable%20state.%3C%2FP%3E%3CP%3EAdditionally%20%22doWipeMethod%22%20can%20be%20canceled%20by%20the%20user%20(power%20cycle%20for%20example)%2C%20%22doWipeProtectedMethod%22%20cannot%20be%20canceled.%20It%20automatically%20resumes%20after%20a%20reboot%20until%20done.%20The%20higher%20risk%20ist%20worth%20it%20most%20of%20the%20time.%20If%20you%20want%20to%20be%20sure%20that%20the%20devices%20will%20be%20in%20a%20usable%20state%20after%20the%20wipe%2C%20use%20%22doWipeMethod%22%20instead.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F637964%22%20target%3D%22_blank%22%3E%40Claire_4%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I've looked for this answer online and have come across the "systemreset -factoryreset" command which works, but it comes up with the prompt asking if I want to keep my files or remove everything, I want to remove everything, but without the prompt. 

 

We are not doing this from any pre-exiting images, and our laptops are running the pre-loaded Windows 10 Pro install, we are just using the in-built Windows 10 "reset this PC" feature as we have no MDM configured. We just want the laptops to be totally reset so they don't contain any company information, we're not bothered about completing the OOBE once they are wiped.

 

We are trying to accomplish this remotely as our users are all at home, so I need to automate it and have no user involvement in the process, I just want it to factory reset, and bring the laptop up to the off-the-shelf state configuration. We have the facility to push commands and scripts to the laptops so was hoping to do this via powershell.

 

Does anyone know if this is possible?

 

Thanks

5 Replies
Highlighted

The systemreset command will show interface to user and it is behavior by design , however if you are able to manage devices using Configuration Manager, you could do it using Full Wipe, take a look at:
https://docs.microsoft.com/en-us/mem/configmgr/mdm/deploy-use/wipe-lock-reset-devices

You could remotely wipe device using Windows Intune too:

https://docs.microsoft.com/en-us/mem/intune/remote-actions/devices-wipe 

 

Highlighted

@Reza Ameri Thanks for your reply.

 

Unfortunately we do not use configuration manager, nor do we have capacity to register devices on InTune currently. 

 

We can run exe's/powershell scripts, that sort of thing on the laptops so we're hoping to use something like that to achieve this. 

Highlighted

@Claire_4 

 

From what I know there is no script to run it in silence mode and wipe system and it is behavior by design, so let say if there is possibility to do so, cybercriminals might run that script and user will lose Windows but it is available in Configuration Manager or Intune, it means PC is being managed by trusted administrator.

 

Highlighted

@Claire_4 

If you have the ability to pull down content, you can pull down Windows 1909 Installer, then run the command to upgrade and clean the system.  The entire thing can be scripted.

 

https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-command-line-opt...

 

 

Highlighted

You can use the MDM WMI Bridge Provider to do what you want. This way you do exactly the same as intune would do.

 

You have to execute the following PowerShell script as SYSTEM. Administrator ist not enough!

To accomplish this, you can either execute the script with task scheduler or use psexec.exe to run powershell as system (psexec -s powershell.exe -file c:\pathtoscript\script.ps1).

 

 

 

 

$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)

 

 

 

 

$methodname can bei either "doWipeMethod" or "doWipeProtectedMethod". The later one will also wipe all data from the disks, especially if you want to refurbish the devices. The downside is that "doWipeProtectedMethod" can leave some clients (depending on configuration and hardware) in an unbootable state.

Additionally "doWipeMethod" can be canceled by the user (power cycle for example), "doWipeProtectedMethod" cannot be canceled. It automatically resumes after a reboot until done. The higher risk ist worth it most of the time. If you want to be sure that the devices will be in a usable state after the wipe, use "doWipeMethod" instead.

 

@Claire_4