Here is a basic script to create a new local user account and restrict permissions:
main.py335 chars13 lines
This script uses the os
module to execute command-line commands. The net user
command is used to create a new user account with the specified username and password. The net localgroup
command is used to delete the new user from the Users
group (which has more permissions) and add them to the Guests
group (which has fewer permissions).
Note that this script should be run with administrative privileges to be able to create new user accounts and manage user groups.
gistlibby LogSnag