NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Group name of currently logged in user

Hi all,
 
In TestStand, how can I find the group name of the currently logged in User ?
 
ie. If an operator named "Oper1" is logged in, how do I find that he belongs to the User Group "Operator" ?
 
Thanks in advance,
 
Sahana
0 Kudos
Message 1 of 6
(3,786 Views)
Hi Sahana,

Please refer to this knowledgebase article and let me know if this addresses your question.

Have a great day,

Ecleamus Ricks, Jr.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(3,762 Views)

Hi Ricks,

I was also trying in the same method as mentioned in the knowledge base article.

I'll briefly enumerate what I did :

1) Call Engine.GetUserGroup method to get the object reference of a particular group.

2) With the object reference above, use the User.Members method to get the Property Object Reference to the members of that group.

3) I then tried to get the number of users in that particular group and I got correct results.

4) I then used PropertyObject.GetPropertyObjectbyOffset to return a object reference and it is stored in the 'Locals.UserObject' variable

5) With the reference from step 4, I tried 'User.LoginName' property to get the Login name of the first member in the group. But I get an error

saying

"Details : Incorrect Object Reference type in 'Locals.UserObject'. A reference to an object of type 'User' was expected.

Error Code : -17308; Specified value does not have the expected type. "

What is the mistake in the above steps ?

Thanks in advance,

Sahana.

0 Kudos
Message 3 of 6
(3,730 Views)

Sahana -
The PropertyObject.GetPropertyObjectbyOffset method is returning a reference to the "reference property object". You could call PropertyObject.GetValInterface on what the above method returns, or instead just call PopertyObject.GetValInterfaceByOffset instead of PropertyObject.GetPropertyObjectbyOffset.

Message Edited by Scott Richardson on 08-22-2006 11:30 AM

Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 6
(3,719 Views)

Hi all,

Is there any way to gray out the group privileges in the NewUser or EditUser dialog when adding an user and configuring a new user as only an operator?

Thanks in advance,

Sahana

 

0 Kudos
Message 5 of 6
(3,691 Views)
Hi Sahana,

I assume you are trying to do this from the User Manager in the Sequence Editor in which case this is not possible.  If you are trying to do this via the Operator Interface, you could potentially create your own User Manager iterface that would exclude that particular property.

Have a great day,

Ecleamus Ricks, Jr.
National Instruments
Applications Engineer

0 Kudos
Message 6 of 6
(3,665 Views)