NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

CreateDeleteUsers

I have all of this working now, except for some error checking, and one issue.  I'm using various activex calls (i.e. DisplayEditUserDialog) to get this working.  The one call to DisplayNewUserDialog, however, is doing something a little wierd.  I have all of this code inside a sequence that (with flow control) stays running until the user decides to cancel out.  Anyway, the first time a user brings up that dialog, they can enter the new user name and select the Group Privileges.  The problem, though, is that if I say OK at this dialog, then go to the Edit User dialog, the new user is in the list, but his Group Privilege is not checked.  If, at that point, I check any of the group privileges for that user, say OK, then go right back into the Edit User dialog, the proper privilege is there.  I'm not sure what is different about the Add New and Edit User that allows one, but not the other, to retain the privilege.  Any ideas of what to check for?
0 Kudos
Message 11 of 15
(1,430 Views)

I thought I had this working, but it's not.  Here's what's happening, and I just don't get it.  On my PC I'm an admin.  In TestStand (4.0.1) I login as an Admin.  In the sequence that does all of this create/delete stuff, if I run, I can add/edit/delete all day long, and see my users if I logout/login.  THIS ALL WORKS AS LONG AS I DON"T EXIT MY HMI.  Once I do, the users I created are no longer present.  In fact, I go to the Users.ini file and it didn't even get updated - it's timestamp is still from months back.  Here's the really weird part.

If I exit the custom TestExec and bring up the sequence editor, the exact same thing happens.   I then realized that (when I'm in the User Manager) it says "Read Only".  How can this be if I'm an admin at the PC and TestStand?  I noticed that in the Admin's privileges, the Grant All was set to false.  I couln't change this until I temporarily turned off the readonly on Users.ini, and then I could change the Grant All.  The add/edit users from the Sequence Editor then worked.  However, whether I have Users.ini readonly or not, neither my version of configure users nor the CreateDeleteUsers.seq (from examples folder) would work like the sequence editor (after users.ini readonly off).  Again, I could add/edit users as long as I stayed within teststand, but all mods went away after I went out of TestStand.  And, the users.ini file timestamp didn't change.

I saw an email in someother thread that mentioned (in passing) the idea of pointing Users.ini that's located in another folder that's accessible to all users.  Is this something worthwhile to pursue?  How does one specify the location of the Users.ini?

My main problem, though, is why don't my custom code and the CreateDeleteUsers.seq  work (why don't they actually update Users.ini)?

0 Kudos
Message 12 of 15
(1,399 Views)

Hi mrbean,

I think we solved this problem over the phone and I thought I'd post our findings here for future reference...

The User Manager being "read-only" is a property of the Users.ini file, it might have got set to read-only when you copied it over to your target machine. You can modify this from Windows by right-clicking the file, opening the properties dialog and unchecking the read-only attribute. (If you are using come kind of source control, try checking out for edit)

The CreateDeleteUsers.seq example lets you add and delete users but does not automatically save the changes to the Users.ini file. This is why (as we found) you get a pop up message asking you if you want to save the changes in User Management and if you click yes, it will save it to the file.

If you want to do this automatically (programatically) without the dialog, you can programatically save the file using the following expression:
RunState.Engine.UsersFile.AsPropertyObjectFile.SaveFileIfModified(False)

Jervin Justin
NI TestStand Product Manager
Message 13 of 15
(1,389 Views)
The only thing that still doesn't work is that, although I can now add/edit/delete users (as an admin), and they are still there when I login as one of those users, I can't change the password of said user.  It (like in the other case) seems to be letting me change the password of the newly-created user, but when I exit/re-enter TestStand, althoght the user is now in the drop down, his password is not.
0 Kudos
Message 14 of 15
(1,384 Views)

Mrbean,

How exactly are you trying to modify the password?

The dialog that you describe (when I exit/re-enter TestStand, althoght the user is now in the drop down, his password is not) sounds very much like the login dialog and here you will be able to pick which user you want to log in as, it is not a user management dialog where you can modify properties.

To modify passwords, you need to go to the User Management page and right click the user you want to modify and click Properties. You can update the password from this dialog.
Keep in mind though that you can only modify other user's passwords if you are an administrator. Other types of users can only modify their own password.
Also note that the value column for the Password in the User Management page appears garbled, this is to prevent other users from seeing a readable version of your password.

Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 15 of 15
(1,356 Views)