Page 1 of 1 1
Topic Options
#77106 - 2003-10-10 03:06 PM When admin is not admin?
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Since migrating to AD we have noticed that although you may be an admin of a pc, there are times when you cannot install or run certain programs. The error message from the programs usually consists of something like "You must be an administrator to run this program." We have checked and in fact are admins.

Yesterday, I was tinkering with a script and included @priv in a if statement. Much to my surprise the script would not run. Finally I figured out @priv was returning "User".

Does anyone know where @priv determines this information, because maybe the two problems are connected.

The following script checks for permissions in various ways and the results for my account are:
code:
Priv       :  USER
Admin Group: True
Local Admin: True

Break on
? "Priv : " + @priv
? "Admin Group: "
if ingroup("\\" + @wksta + "\administrators")
"True"
else
"False"
endif
? "Local Admin: "
if localadmin()
"True"
else
"False"
endif


function LocalAdmin()
$LocalAdmin=ingroup('@wksta\'+sidtoname('S-1-5-32-544'))-1+@inwin
endfunction

Top
#77107 - 2003-10-10 03:23 PM Re: When admin is not admin?
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
@PRIV returns the network primary group privilege level (I believe).
Top
#77108 - 2003-10-10 03:30 PM Re: When admin is not admin?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yes, @PRIV does not care about the local privilege level, just the domain.

[ 10. October 2003, 15:30: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#77109 - 2003-10-19 07:47 PM Re: When admin is not admin?
Everyone Offline
Getting the hang of it

Registered: 2003-10-19
Posts: 81
Loc: Beale Air Force Base, CA
I ran into a simular problem recently.
Upgraded from an NT 4 domain environment, to a Server 2003 Active Directory environment.

They only let us have Directory Service Operator, and Resource Admin rights, so kix shows @priv as User when logging on to the network. Log on as a local admin to the workstation, and it will show Admin.

Top
#77110 - 2003-10-19 09:19 PM Re: When admin is not admin?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
@PRIV is a poor choice to distinguish between privilege levels. And @PRIV is actually working correctly in your case.
_________________________
There are two types of vessels, submarines and targets.

Top
#77111 - 2003-10-27 05:33 AM Re: When admin is not admin?
jacks73 Offline
Getting the hang of it

Registered: 2003-04-23
Posts: 58
Alpo,

I also had a similar problem after an upgrade from NT4 to W2K network environment. The @primarygroup for some reason would not resolve properly. The solution that worked for me was to make ALL users created in the NT4 domain part of the "Pre Windows 2000 users" group. It may sound funny but give it a test run on a few users.

J

Top
#77112 - 2003-10-27 02:50 PM Re: When admin is not admin?
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Thanks for Hope!

I've passed this up the chain and will let you know if I get anywhere.

Thanks again.

Top
#77113 - 2003-11-06 06:52 PM Re: When admin is not admin?
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Thanks for the suggestion. Finally got someone from above to stick me in the group... but unfortunately it didn't help in this instance. [Frown]

As a side note, since starting this thread, I replaced my 2000 pc with XP Pro. If I run the program in compatibilty mode it works...

Thanks again.

Top
#77114 - 2003-11-07 01:51 AM Re: When admin is not admin?
microcephalic Offline
Fresh Scripter

Registered: 2003-10-17
Posts: 16
I am having the same problem with the @priv macro...

Always says 'user' even though I'm an admin. Running on windows XP in NT 4 based domain...

Top
#77115 - 2003-11-07 02:20 AM Re: When admin is not admin?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
now, micro, are you domain admin?
if not, please read the topic before reply.
_________________________
!

download KiXnet

Top
#77116 - 2003-11-11 10:03 AM Re: When admin is not admin?
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
I think @PRIV should be remade to return both local and domain status...
_________________________
The tart is out there

Top
#77117 - 2004-05-04 08:11 PM Re: When admin is not admin?
caswell Offline
Lurker

Registered: 2001-11-16
Posts: 4
I'm afraid I'm not following this. Did you ever solve this or find a work around for installing programs? Are you just not using Kix to try to find priv level and going by what the program reports?
Top
#77118 - 2004-05-04 08:14 PM Re: When admin is not admin?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What's to follow? Run the sample code and post back the results.

My results:
Quote:


Priv : USER
Admin Group: True
Local Admin: True
C:\KiXScripts>


_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#77119 - 2004-05-04 08:30 PM Re: When admin is not admin?
caswell Offline
Lurker

Registered: 2001-11-16
Posts: 4
Sorry, I didn't see a request to test. I have over 800 workstations and only some have this problem. My test machines work fine with Domain User accounts (with the /f switch). I originally thought this had something to do with us "ghosting" machines, so the SID in the cache didn't machine the SID on the new machines, but my most recent results contradict that. Won't be getting around to test any time soon.

Anyway, the this thread seems to tell me that this function is problematic and should be avoided, unless someone has some work around I haven't seen yet, or I'm misunderstanding.

Top
#77120 - 2004-05-04 08:55 PM Re: When admin is not admin?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You were given a reference to this thread basically for the little scriptlet to test. To take your problem to this thread is considered hijaaking. You should post to the topic you started.
Ingroup

This thread's topic is about @Priv and not about InGroup. There is no "problem" here per se, except for a misunderstanding of how @Priv works.

That said, this example of InGRoup() differs from yours whereby it does not look for <>1. Also there is an example of a LocalAdmin() UDF that is immune to localization.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#77121 - 2004-05-07 08:09 AM Re: When admin is not admin?
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Thought I'd seen it before:

Problem with the @Priv Macro
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

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
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.071 seconds in which 0.029 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