Hey guys,
I recently tried executing a script to change the user from admin privilage to a standard one. The script I have uses a in-script variable to fetch the user that is currently logged in when the script runs. And this variable is used in the commands to change the account type. At first I tried it on the device manually, that succeeded but as I run it through the portal, it failed. When the script output is checked, a curious message is seen “The script execution was terminated abruptly. Please try again when the device is awake and idle.” Does anyone have a clue why this message is popping up.
This is the script I have used:
set var=%userprofile%
set var=%var:C:\Users\=%
net localgroup Users %var% /add
net localgroup Administrators %var% /delete