Page 2 of 2 <12
Topic Options
#47195 - 2003-10-22 10:27 PM Re: Use of InGroup
Scott A. Chase Offline
Fresh Scripter

Registered: 2003-10-22
Posts: 5
Jens,

I am not sure what you base your opinion of my script on considering I posted a basic select/case bit of code five lines long but I will accept your judgement.

I confess I learned this script language on my own and am not a programmer. I have three page logon script that has worked since 1997 to map user and departmental shares for 120 people with practically no problems. And, I solved two of my problems today with no help from you. I figure this will be the last time I use this board.
Scott

Top
#47196 - 2003-10-22 10:35 PM Re: Use of InGroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Scott:

the "messed up script" comment is based on soemthing you said yourself:
quote:
However, I have encountered a situation where I have had to use "InGroup32" or "InGrp." I don't know why and I can find no documentation on this. For example, the following
The use of these lines of code are basically bypassed by KiXtart, thus whatever you tried to achieve is not working correctly. And a script that does not work correctly and is using incorrect syntax can be called "messed up", IMHO.
_________________________
There are two types of vessels, submarines and targets.

Top
#47197 - 2003-10-22 10:39 PM Re: Use of InGroup
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Think what Jens and I and some others are probably scratching our heads over are these InGrp and InGroup32 and Unlock references. Trying to figure out what these are exactly ... if they are UDF's then that is all well and good. If not then they sound like cmdline utilities being SHELL'd out to ...

Could you post a line or two, from this other Kixscript that uses InGrp or Unlock ?

-Shawn

Top
#47198 - 2003-10-22 10:47 PM Re: Use of InGroup
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Scot,

They are just trying to help.

Like Kent said...

quote:

You should get the desired effect with:

code:
IF InGroup("MIS") AND @WUserID = "sys-sc"
USE X: "\\POR-NT1\SCANS$"
ENDIF


...should work.

It is just comment about your script, don’t take it personal. I'm sure someone here could come up with a nice working version with best practice clean coding. Actually Kent posted a sample which should work. If not please let us know what you get and some extra requirements for the script maybe.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#47199 - 2003-10-22 10:52 PM Re: Use of InGroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
They can't be UDFs if the KiXtart version is from 1997 as that would imply a v3.6x max.

I think the code just contains 'INGRP32' and it 'works' because kiXtart does not throw an 'incorrect function' or 'unknown function' error.

If the script would be run in debug mode, one would clearly notice that those lines of code are not processed 'correctly' as they are not processed as a function.

code:
if ingroup32('Domain Users')
? 'User is member of group "Domain Users"
endif

might look to somebody as if it would work correctly even though it does not work 'as the writer intended'. The writer just got lucky that it didn't break.

Anyway, Scott, please type 'kix32 /?' at the command prompt and let us know the Kixtart version!

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

Top
#47200 - 2003-10-22 10:52 PM Re: Use of InGroup
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Basta,

Found Unstick etc for you... See the kixtart.doc from version 2.33:
quote:

This version of KiXtart is bundled with four separate utilities :

INGRP32 Win32 applet enabling you to check for membership of a Local Group (on Windows NT systems)
LOCKLOG deny LAN access under Windows unless logonscript is run...
SETW enables you to SET environment variables in the Windows environment
UNSTICK DOS applet enabling you to remove permanent redirections on Windows for Workgroups 3.11 systems

Please see the separate documentation for full details on these utilities.


_________________________
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
#47201 - 2003-10-22 10:54 PM Re: Use of InGroup
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Well, I just printed off and re-read thread and I think it's clear that Scott understands that the InGrp and or InGroup32 in the other script, while not being proper syntax, is kinda working anyways by virtue of the @WUserID working as intended ...

But none the less, would recommend you re-visit this other script and correct the syntax and root cause the initial reason for the InGroup("xxx") failure ... think we all (I do anyways) understand this more ...

Top
#47202 - 2003-10-22 10:55 PM Re: Use of InGroup
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
And INGRP32.exe info:

code:
@echo off
rem
rem INGRP32.EXE is a Win32 executable enabling you to
rem check for membership of a global and / or local group.
rem
rem Usage : INGRP32 [ group name ] (eg : INGRP32 "Domain Users")
rem
rem returns : errorlevel 0 = not a member of group
rem errorlevel 1 = member of global group
rem errorlevel 2 = member of local group
rem errorlevel 3 = some sort of API error
rem
ingrp32 %1
if errorlevel 3 goto err
if errorlevel 2 goto local
if errorlevel 1 goto global
goto end
:global
echo Member of global group
goto end
:local
echo Member of local group
goto end
:err
echo Huh ?. API error occured
:end

(this code was entered in ingroup.bat)

[ 22. October 2003, 22:56: Message edited by: MightyR1 ]
_________________________
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
#47203 - 2003-10-23 03:17 AM Re: Use of InGroup
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You never stop learning... [Embarrassed]

The 16-bit old KiXtart v2.33 as a login script processor for 32-bit Windows operating systems.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 2 of 2 <12


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

Who's Online
1 registered (Allen) and 692 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.057 seconds in which 0.025 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