Enable local administrator account
R
Robin
Hi Doreen D'Silva
Please check out this script from our library
https://scripts.itarian.com/frontend/web/topic/script-to-create-or-delete-user-account-and-add-or-remove-to-given-group
We also have other local user scripts too
Doreen D'Silva
Robin: im not want to create or delete, there is an existing built in administrator inside windows which is disabled by default - i want to enable it, set password and then tick password never expires.
R
Robin
Doreen D'Silva: You could use the script from this link https://scripts.itarian.com/frontend/web/topic/script-to-create-or-delete-user-account-and-add-or-remove-to-given-group and delete everything from line 33 onwards.
Simply add the following at the end instead
ret,out,err = ecmd('net "%s" /active:yes'%(username))
if ret==0:
if out:
print(out)
print('successfully activated the user account')
else:
print(err)
ret,out,err = ecmd('net user "%s" %s'%(username,password)
if ret==0:
if out:
print(out)
print('successfully set password')
else:
print(err)
ret,out,err = ecmd('net user "%s" /passwordneverexpires yes'%(username)
if ret==0:
if out:
print(out)
print('successfully set password to never expire')
else:
print(err)
This should do the trick!