This example adds functionality to the default TestStand Login procedure to automatically create a new TestStand user corresponding to the current windows user if one does not exist. If you have the "Automatically Login Windows System User" Option selected in the station options, the new user will be logged in automatically.
The attached example will login any Windows user with Operator privileges and therefore the login dialog will not show through the following steps:
Obtain the Windows System Username using a Call Executable Step to retrieve the value or the username environment variable.
Parse the name to remove the space at the end (since we can not create a username with a space in TestStand).
Create the user and insert that user into the operator group using the TestStand API.
Call the existing login/logout code. If the "Automatically Login Windows System User" Station Option is enabled, the new user is automatically logged in.
TestStand 2016 or compatible
Steps to Implement or Execute Code
If you would like this functionality, simply rename your default frontendcallbacks.seq (found in <TestStand>\Components\NI\Callbacks\FrontEnd or <TestStand>\Components\Callbacks\FrontEnd) and rename the attached file to frontendcallbacks.seq. Place the attached file in the FrontEnd folder. Now when you run the NI Sequence Editor the sequence called will have the behavior described above.
Download and Extract the attached example
Copy the FrontendCallbacks file into the following location: <TestStand Public>\Components\Callbacks\FrontEnd
Close and Reopen the TestStand sequence editor.
With warm regards,
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.