Manage user accounts in the endpoint using procedure - This one does not allow me to create a custom admin, or allow me to promote a standard user to admin
Enable the admin account and hides the admin account from the login screen. - This one doesn’t allow me to set a password.
Enable the remote control and administrator account. - This one enables RDP on top of enabling an admin account, which I don’t want as a side effect. (personally I think those should be 2 separate scripts.
I am in need of a script to create a local custom admin. The script should allow me to:
Specify local admin name
Specify password
It should be compatible with windows 7, 8, 8.1 and 10.
Hi @caronet
I was able to download the Python script that is attached in @Prabakaran’s post.
Perhaps, the actual Python code will be better. Just create a new procedure in the ITSM Procedures section, copy+paste the code below, edit the necessary variables, and then save. Make sure to run it as a LocalSystem User.
uN = "xxxx" #provide username for this account
pwd= 'yyyy' #provide password for this account
import ctypes
import subprocess
import os
class disable_file_system_redirection:
_disable = ctypes.windll.kernel32.Wow64DisableWow64FsRedirection
_revert = ctypes.windll.kernel32.Wow64RevertWow64FsRedirection
def __enter__(self):
self.old_value = ctypes.c_long()
self.success = self._disable(ctypes.byref(self.old_value))
def __exit__(self, type, value, traceback):
if self.success:
self._revert(self.old_value)
def createuser():
with disable_file_system_redirection():
AddUser= 'net user ' +uN+' '+pwd+ ' /add /passwordreq:yes'
Createusr=os.popen(AddUser).read()
acc= 'net localgroup administrators ' + uN + ' /add'
adminacc=os.popen(acc).read()
print "successfully executed all the operation "
createuser()
When I create a new procedure with this code, and the try to attach it to a new profile - The procedure does not show up in my procedures list to so I can choose it.