Change the User Account
When Analytics components are installed, the default Windows Network Service account is automatically used by each of the installed components when running local services. However, an advanced option is available to override the default account and specify a different user account.
Update Permissions
The default account can only be overridden with another user account that already exists in the system. Before running the command to change the service user account, update the permissions on the existing account you intend to use.
1. Open the Windows Explorer and navigate to the installation directory:
For the Analytics Server installer: C:\Program Files (x86)\ThingWorxAnalytics\Thingworx_Analytics_Server
For the Platform Analytics installer: C:\Program Files (x86)\ThingWorxAnalytics\PlatformAnalytics
2. Right click the installation directory and select Properties. A Properties dialog box opens.
3. Open the Security tab and click Edit. A Permissions dialog box opens.
4. Click Add to add a user to the permissions for the installation directory. A Select Users or Groups dialog box opens.
5. In the field at the bottom of the dialog box, enter the name of the user account you want to assign permissions to and click Check Names. The system verifies that the user exists and adds the domain name (if applicable).
6. Click OK. The selected user name is added to the list of users with permissions to the installation directory.
7. In the list, select the newly-added user and in the permissions for that user below, on the Full Control row, select the Allow check box.
8. Click OK to close the Permissions dialog box and redisplay the Properties dialog box.
9. Because the installation directory includes subdirectories that also need the same permissions, click Advanced. The Advanced Security Settings dialog box opens.
10. Click the check box at the bottom of the dialog box: Replace all child object permission entries with inheritable permission entries from this object.
11. Click OK to save the settings and close the dialog box.
12. Click OK to close the Properties dialog box.
Override the Network Services User Account
To override the default services user account, follow the steps below for each component you have installed. To change the default account for all components, run the procedure individually for each component.
1. Open the Windows PowerShell, or a Command Prompt, in Administrator mode.
2. Navigate to the bin folder of the installation directory:
For the Analytics Server installer: C:\Program Files (x86)\ThingWorxAnalytics\Thingworx_Analytics_Server\bin
For the Platform Analytics installer: C:\Program Files (x86)\ThingWorxAnalytics\PlatformAnalytics\bin
3. If you have installed Property Transform and chose to install the instance of RabbitMQ provided with the installer, update the .erlang.cookie as follows:
Copy the.erlang.cookie from C:\Windows\ServiceProfiles\NetworkService directory.
Paste the.erlang.cookie to your home directory. For example: C:\Users\Administrator
4. Execute one of the following commands:
In Windows PowerShell: .\changeServiceUserAccount.ps1
In Command Prompt: powershell -executionPolicy bypass -file "changeServiceUserAccount.ps1"
A Credential Request dialog box opens.
5. Enter a User Name (or a domain/user name combination) and a Password in the respective fields. The new account can only be created for a user that already exists in the system.
6. Click OK.
The system authenticates the user account and updates the relevant services to run as the authenticated user.
7. To check the updated user for a service:
Navigate to the local services on your computer. The path to these services will vary based on your version of Windows. (Example: Administrative Tools > Services)
Check the value in the Log On As column for affected services. Instead of Network Service, you should now see the new user account. Affected services can include:
twas services for the ThingWorx Analytics Server
twpas services for Descriptive Analytics and Property Transform services
8. Restart the services as follows:
Navigate to C:\Program Files (x86)\ThingWorxAnalytics\PlatformAnalytics\bin
Run the command .\twpas.bat stop
Check the Local Services to ensure the RabbitMQ service has stopped.
From the bin folder above, run the command .\twpas.bat start
Was this helpful?