Jump to content
Sign in to follow this  

Need help adding local admin to Computers

Recommended Posts

I'm very new to scripting and Automate but we used to have Continuum and we were able to easily add a local admin to the computers.  How can I do that in Automate?  Please keep in mind I'm not a scripting guru, very novice.


Thanks in Advance

Share this post

Link to post
Share on other sites

One of the best lines I've heard when learning about Automate is "If it can be done in shell Automate can do it". I created a script to use windows Net User commands to make the account, set it as local admin, and set the local password to not expire. We also got a little fancier with it and have it use an extra data field set at the client level so each client had their own unique password but it was uniform for the entire client.

Extra Data field get value (pulls in the EDF for the client to know what to set the password to)

shell enhanced  and continue on failure for each of these:

net user <username> @<password variable>@ /add

net user <username> @<password variable>@

net localgroup administrators <username> /add

net user <username> /expires:never"


I have it set the password twice since we had issues where if the user already existed it wouldn't update the password. That way we could change the password if it were compromised as well. I schedule this script to run daily so any new machine or password change gets pushed out automatically. I just need to update the password in the passwords tab and the EDF I created


Share this post

Link to post
Share on other sites

So let me see if I got this,  I will use a example username and password so I have an understanding.

net user <testadmin> @<password1234>@ /add

net user <testadmin> @<password1234>@

net localgroup administrators <testadmin> /add

net user <testadmin> /expires:never"

Is that the correct syntax? 

Appreciate the help!

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...