KB-32656: Retrieving information on the user logged to the application.

Question:

How can I retrieve, via scripts, both user name and user group to which this user belongs?

Solution:

Username is retrieved by Viewer‘s User property.

Example:

dim user

user = Application.User

msgbox “Logged user: ” & user

To confirm the name of the group to which the user belongs, you will need to use Viewer‘s IsUserMemberOfGroup(GroupName) method. GroupName parameter must indicate the name of the group to which you want to consult.

Example (script checking whether user belongs to Admin group):

if Application.IsUserMemberOfGroup(“Admin”) then

        msgbox “This user is an administrator.”

end if

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *