Kaseya Community

Creating a local user account with admin rights after determining if the user already exsists

  • ***Introduction of myself***


    I want to say this is my first time posting on the forums. I am relatively new to the Creating of Agent procedures at my company, but I have been using Kaseya for about 9 months now. I am interested in truly harnessing the power of Agent Procedures in order to simply administration of our clients and improving efficiency as I am sure many of you who are here are. And I look forward to being apart of this community.

    Thank you ahead of time for your help!

    *** My Problem ****

    I m having a problem where many of our existing clients have computers that were not setup or deployed by us, but they are being supported none the less. I want to ensure myself and the techs I work with have an easy way to administer these computers and my first step is to create a Procedure that will allow us to create a local administrator account that is the same on every computer and has the same password. And this Procedure can be run multiple times on the same computer without adverse effects.

    *** Question starts Here ****

    How do I go about writing a Procedure that will accomplish the below tasks?

    1. If a local account on the computer. e.g.  "kaseyaadmin" is true.

    2. Then reset the password to my given password. e.g "Kaseya1234"

    3. Else Add the account, promote the account to administrator, and add the given password.

     - For my check step ( this is the part I really need help with) 

    I currently thought of doing this by creating a procedure that looks in the below registry key area for the user name i am trying to find but the random string is giving me problems on how to get around. 

    "HKEY_USERS\S-1-5-21-345791448-2589195411-1569685992-1013\Volatile Environment\USERNAME

    I also thought that it may be possible to looks to Kaseya's audit data to look at the users, that Kaseya is aware are on the computer. But, this may be less reliable.

    - For my reset step I can accomplish that with a Shell Command

    - And for my Final Step I was just going to use the "createLocalUser' statement in the agent procedure editor.

    Again, Thank you for your time and comments!

  • Hi, I user a command line to check if a user exists, then either reset the password or create the account.

    Here is part of my script. You need to set the username and password variables (that's what the missing lines 1 and 2 do).




  • You don't actually need to create a procedure for this.

    If you go to Remote Control > Reset Password - now fill in the blanks with your username password combo making sure to tick the Create New Account box and run on all machines - this will create where the account doesn't exist - you may need to run again without ticking the box and it will set the password for all those accounts that already existed.

  • I did already know about this and I have used to some success but it doesn't seem to work 100% of the time and I plan on doing some additional steps with this procedure in the future, also I plan on adding it to a policy so that it doesn't have to be done manually and is instead done once we place the agent into its correct group and then we can even create customer specific local logins more easily later down the road.

    Thank you for the suggestion though.

  • Andy,

    Thank you very much for your response. I was able to take what you gave me and use it for exactly what I wanted to do and also expand on it. You have made my first Journey into the Kaseya forums a positive one.