Overview
This example adds an existing TestStand user to an existing User Group such as Administrator, Operator, or Technician. This example also demonstrates how to generate a list of users and user groups using the TestStand API
Description
This example uses the TestStand API to add an existing user to a user group. The example implements the following tasks
- Access the list of users and use groups using the Engine.UsersFile.UserList and Engine.UsersFile.UserGroupList. These properties are arrays of PropertyObjects, and can be iterated using the GetPropertyObjectByOffset method
- Add the user to the group using Engine.GetUserGroup("group").Members.SetValStringByOffset(0,1,"UserName")
- Save the changes to the Users using Engine.UsersFile.AsPropertyObjectFile.WriteFile()
Hardware and Software Requirements
TestStand 2014 or Compatible
LabVIEW 2014 or Compatible
Steps to Implement or Execute Code
- Extract the attached archive, and open the Add Existing User To Group.vi.
- Run the VI. Observe that the dropdowns contain a list of users and user groups on the system.
- Select a user and a group, and click the "Add User" button to add the user to the group.
- Open the sequence editor, and verify that the change is shown.