Simple worker to know how to manage this type of app
- Execute the script
Create-User.ps1
, to create the User; - Log on as a service rights
- Open the Local Security Policy editor by running
secpol.msc
. - Expand the Local Policies node and select User Rights Assignment.
- Open the Log on as a service policy.
- Select Add User or Group.
- Provide the object name (user account) using either of the following approaches:
- Type the user account ({DOMAIN OR COMPUTER NAME\USER}) in the object name field and select OK to add the user to the policy.
- Select Advanced. Select Find Now. Select the user account from the list. Select OK. Select OK again to add the user to the policy.
- Select OK or Apply to accept the changes.
- Open the Local Security Policy editor by running
- Execute the script
Install.ps1
, to install the service into the machine.- Parameters:
- Path - Where the files are;
- ExeFileName - The name from the
.exe
; - UserName - The user that will execute the service;
- Password - Secure string containing the password for the user (SecureString docs);
ConvertTo-SecureString "{password_here}" -AsPlainText -Force
- Name - The service name;
- DisplayName (Optional) - A friendly name for the service;
- Description (Optional) - Explain what is the purpose of the service;
- Parameters:
For further information check the Microsoft Documentation.