Jump to content
Sign in to follow this  
levanduyet

How to check the user group

Recommended Posts

levanduyet

Hi All,

I am making the installation file.

I want to check the "Administrator" before let the script do something.

If I use the following code:

If @UserName <> "Administrator" Then
 
EndIf

in some case, it's not correct because the user may change the name but they are still "Administrator group".

So, How can I check the user in "Administrator" group or not?

Tks,

LVD

Share this post


Link to post
Share on other sites
Akarillon

If you mean that the user can change username, but still be in the administrator group, then check the SID of the user(this value will never change)


Challenge accepted!

Share this post


Link to post
Share on other sites
water

If you want to check the users rights then use function IsAdmin().

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
hannes08

Or you could try using

#RequireAdmin

on top of your script so it always runs with administrative privileges.


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×