A user wondered if there was a way to kick off the Windows "systemreset -factoryreset" command with a script from Edge, as an alternative to the user going into recovery mode, but it seems that a prompt is required which will be unanswered if the user is not logged on. The user would not like to automate this process and the solution may not be worth the effort required to make it 100% safe.
Read the entire ‘How to Kick off Windows Systemreset Command from Edge?’ thread below:
anyone have a script that can kick off the windows "systemreset -factoryreset " command when a laptop is only at the login prompt for Windows? i wont bore you with the details but wondering if theres any way to kick that off from Edge (via a script or using the remote cmd prompt possibly)
A quick and dirty way to see if there are any LOCAL users logged on (does not work for remote, I’m assumingthat as this is in Edge we are talking about a single user endpoint device here) is this:
If ((Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object UserName).Count -eq 0) {
`Write-Host ‘Party on, Garth’`
}
It is just a matter of putting the right command in there. However, from waht I read it seems you cannot run the ‘systemreset’ command 100% silent, it will always prompt for confirmation? Not sure what the heck that will do if the command is run in System context and there is no user context to raise that prompt in. It may just pop up the prompt like a good little computer, or try and pop it in System which would probably send that prompt to GUI purgatory, never to be answerred…
For some reason, this is one I’m less willing to test on my desktop 😁
haha weird i know 🙂
but ya this would be only in an emergency basis if it boots, cant login and not in intune anymore so was HOPING if its just at the no one logged in state that we could use Edge maybe to kick it off so they didnt need to go into recovery mode first ya know but no luck so i’m thinking it might be a gui promptwhich wont show if the user isnt logged in of courseIt may show, depends on how the internal code is. Grab a spare device and give it a shot?
I’m curious here, under what conditions would a machine not be in Intune anymore and login is borked? Sounds like the OS is so far gone no network connected services can be relied on. Do you still see a device in Edge in this state?
i actually am testing w/ a spare laptop but not doing anything. seems to take the command fine though. but ya hopefully not something we hit often but in yesterdays case the machine was working in the morning and then they claim they got some microsoft account pop up issue (didnt know what it said and she rebooted and was never able to sign in again. we noticed it was gone from intune and autopilot and no audit log of anyone removing it. i did see it in Defender , controlup and teamviewer (those get deployed w/ intune) so it was super weird
hopefully a super isolated incident beecause usually we’d kick the fresh start from Intune but thought might be a good way to leverage controlup in a pinch if it workedas far as edge was concerned the machine looked ok. i could use a remote shell, remote assist (to see the login page she was on) and even send commands but thats itso my thought was use my test laptop here , leave it in the unlogged on state and see if i can kick that reset offHmmm… I think you can get this to work safely with some dirty tricks, but I would not automate it, just in case. The amount of effort you would need to put into a script that is 100% safe is probably not worth it.
yup i agree….so we dont nessesarily want to automate it, really just if our help desk gets a call w/ this type of situation thought maybe if there was a way they could kick off a command/script that just STARTED the reset steps so the user didnt have to be walked through going into recovery and doing it . not a big deal but just thought i’d see if anyone had any ideas
Continue reading and comment on the thread ‘How to Kick off Windows Systemreset Command from ControlUp Edge DX?’. Not a member? Join Here!
Categories: All Archives, ControlUp for Desktops, ControlUp Scripts & Triggers