?
Solved

Perl + NT Users

Posted on 2000-02-02
5
Medium Priority
?
205 Views
Last Modified: 2010-03-05
I need to make a logon script for the users wich logon in a NT domain.

I need to know if it's possible to know if the user who is logging belongs to a specific group?

So the srcipt should say:

if "usergroup" == "GROUP"{
    ----Actions----
}

Thanks.
0
Comment
Question by:Pampa
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:guadalupe
ID: 2482916
$EFFECTIVE_GROUP_ID   or  $REAL_GROUP_ID

or on some machines/versions which only support the short version:

$)     or     $(
0
 
LVL 5

Accepted Solution

by:
thoellri earned 400 total points
ID: 2482931
Win32::NetAdmin is your friend. If you don't have this module installed you can get it from www.activestate.com/packages/zips

It offers two functions GroupIsMember and LocalGroupIsMember which test if a certain username is member of a local of NT domain group.

I was successful testing this against my own account using the code below for a local group check:


use Win32::NetAdmin qw(LocalGroupIsMember);

print LocalGroupIsMember("","Administrators","thoellri"),"\n";

Hope this helps
  Tobias
0
 
LVL 1

Author Comment

by:Pampa
ID: 2482945
Please send me the code because I try your solution and it doesn't works.
Do I have to include any Library?
0
 
LVL 5

Expert Comment

by:thoellri
ID: 2482961
Are you talking to me Pampa?
0
 
LVL 1

Author Comment

by:Pampa
ID: 2485284
Toellri No, the comment was for Guadalupe....

I will try your solution today, thanks.

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question