Jump to content

User Priviledge Check?


Recommended Posts

Hi all,

I have a script that I have been working on for a while now. I've been tied up with other things lately so it has been awhile since I last worked on it. Anyway, the script is for programming a multitude of serial devices that we use at my work. I have it almost worked out, but there is one annoying little item I would like to fix if I can. When the script launches, it kind of checks for Administrator rights by using

CODE
If @UserName <> 'Administrator' Then

But that doesn't always work. For example, if I have a use that is an Administrator on their PC, but the account is not called "Administrator" this method still requires them to enter a user name and password. Is there anyway that I can check to see if the current user is an Administrator and if so how? I did a few different searches here as well as in the help manual, but haven't been able to find anything. Also, I'm not sure if this matters or not, but this script could be used in either a work group, i.e. local users or in a domain (AD users).

Thanks for any help.

Dave

Link to comment
Share on other sites

Manadar,

First, thanks for the quick reply and the point in the right direction. Second, contray to what you believe I actually did search, both here on the forums and in the help file. But I will say I didn't think it would be as simple as searching for "admin". I searched for privileges and user accounts as that is what I am checking for. From looking at the help file, it looks like IsAdmin is what I need.

Thanks again.

Dave

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...