Perl + NT Users

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.
LVL 1
PampaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

guadalupeCommented:
$EFFECTIVE_GROUP_ID   or  $REAL_GROUP_ID

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

$)     or     $(
0
thoellriCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PampaAuthor Commented:
Please send me the code because I try your solution and it doesn't works.
Do I have to include any Library?
0
thoellriCommented:
Are you talking to me Pampa?
0
PampaAuthor Commented:
Toellri No, the comment was for Guadalupe....

I will try your solution today, thanks.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.