Disable user

You can use below script to disable any user,

import os;
result=os.popen('net user administrator  /active:no').read();
print(result);

sample output would be,

output.jpg

How would you make it so it does a popup/alert to ask for user instead of always administrator?

HI @ertonemad

Above script was executed by custom user account with administration privilege . However a normal user or guest user not able to disable admin account.

Hello @ertonemad ,

You can replace “administrator” with any user name in the net user command. Is that what you need?

i know you can change user name… but that requires editing the code each time…i was just thinking that a popup so a user can be inputted would be awesome! :slight_smile:

@ertonemad

Upcoming release (October 8-9) will have an option to run procedures as logged in user so that you can interact with users. You can get any input by asking the user or show any output to them.