Page 1 of 1 1
Topic Options
#50423 - 2000-06-28 03:18 PM @PRIV and local admin rights
Porquerizo Offline
Fresh Scripter

Registered: 2000-05-16
Posts: 25
Loc: Leuven, Belgium
Hi,

I use @priv to check if the user have admin rights in order to execute the Superdat from McAfee. I created a Global Group "Admin WS" and added this group into the Local Group "Administrator". It is not working If I check with:

If UCASE("@Priv")="ADMIN"
$Selection = MessageBox($Msg1, $MsgTitle , 64 )
shell $SdatPath + $SdatName + " /silent /logfile " + $ReportPath + @wksta + ".log"
$LastAction="Ran $SdatPath$SdatName - Error: " + @error
Else
$Selection = MessageBox($Msg2 , $MsgTitle , 48)
$LastAction="Scan Engine has to be updated"
Endif


Any idea how I can make it work???

_________________________
Cheers, Porq.

Top
#50424 - 2000-06-28 08:03 PM Re: @PRIV and local admin rights
BoxKite Offline
Da Box
*****

Registered: 2000-05-17
Posts: 282
Loc: Vacaville,CA,USA
Try this:

code:
If UCASE("@Priv")="ADMIN"
$Msg1 = "Updating Anti-Virus" $MsgTitle = "Administrative Message"
MessageBox($Msg1, $MsgTitle , 64 )
shell "%comspec% /c $SdatPath\$SdatName /silent /logfile $ReportPath\@wksta.log"
$LastAction="Ran $SdatPath$SdatName - Error: " + @error
Else
MessageBox($Msg2 , $MsgTitle , 48)
$LastAction="Scan Engine has to be updated"
Endif

------------------
BoxKite
FACTA NON VERBA

_________________________
Box
FACTA NON VERBA

Top
#50425 - 2000-06-29 10:21 AM Re: @PRIV and local admin rights
Porquerizo Offline
Fresh Scripter

Registered: 2000-05-16
Posts: 25
Loc: Leuven, Belgium
Hi BoxKite,

sorry maybe I wasn't clear in my first post.

The line --If UCASE("@Priv")="ADMIN"-- is the problem, because the user have to be admin on the DOMAIN, but I want to know a solution to test if the user has LOCAL admin rights.

So: How to test if a user have LOCAL admin rights.

Thanks and Cheers from Belgium

_________________________
Cheers, Porq.

Top
#50426 - 2000-06-29 05:58 PM Re: @PRIV and local admin rights
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
give this a try.

code:

select
case ingroup("\\@wksta\Administrators") = 0
? "@userid is not a local admin on @wksta"
case ingroup("\\@wksta\Administrators") = 2
? "@userid has local admin rights on @wksta"
endselect



Bryce

Top
#50427 - 2000-06-29 07:39 PM Re: @PRIV and local admin rights
BoxKite Offline
Da Box
*****

Registered: 2000-05-17
Posts: 282
Loc: Vacaville,CA,USA
HMMMMMmmmmmm……….
HMMMMMmmmmmm……….
HMMMMMmmmmmm……….

OK, gottcha, local admin

Houston, we have a problem

The information to make this work is maintained in the SAM in the registry. NT will not allow you to use Kix functions ENUMKEY or ENUMVALUE to read the SAM.

Hopefully the solution offered by Bryce will meet your needs.

_________________________
Box
FACTA NON VERBA

Top
#50428 - 2000-07-01 12:35 AM Re: @PRIV and local admin rights
Porquerizo Offline
Fresh Scripter

Registered: 2000-05-16
Posts: 25
Loc: Leuven, Belgium
Thanks a lot Bryce - it works.

I was doubting if I saw your solution, because my users are not member of the local group "Administrators" but member of the global group "Local Admin WS" which is itself member of the local group "Administrators".

So, actualy what I wanted to say is, that even if the user is bidirect member: YOUR SCRIPT IS WORKING

Thanks a lot - this problem kept me busy for a few days.

Cheers,
Mario

_________________________
Cheers, Porq.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.053 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org