Steve M
(Fresh Scripter)
2002-12-02 07:35 PM
INGROUP problem

Hi all,
I just added a line to my script and cannot figure why it does not work. The other ingroup works and it is identical to the new one I added.
The TRAKKER group works and it displays that you are a member of TRAKKER but it does not display the REALEC so it does not map. THe user is definetly in the REALEC group.

code:
if INGROUP("REALEC")
USE R: /delete /Persistent
use R: "\\FS1\REALEC"
? "Member of REALEC group"
endif
sleep 5

if INGROUP("TRAKKER")
USE L: /delete /Persistent
use L: "\\TK2\TRAKKER"
? "Member of Trakker group"
ENDIF
sleep 5



Kdyer
(KiX Supporter)
2002-12-02 07:40 PM
Re: INGROUP problem

Does this work?

code:
 IF INGROUP("REALEC")
USE R: /DEL /PERSISTENT
USE R: "\\FS1\REALEC"
? "Member of REALEC group"
ENDIF
SLEEP 5
IF INGROUP("TRAKKER")
USE L: /DEL /PERSISTENT
USE L: "\\TK2\TRAKKER"
? "Member of Trakker group"
ENDIF
SLEEP 5

HTH,

Kent


Steve M
(Fresh Scripter)
2002-12-02 07:52 PM
Re: INGROUP problem

No, that did not help.
I am using 4.1 version if that helps


LonkeroAdministrator
(KiX Master Guru)
2002-12-02 07:55 PM
Re: INGROUP problem

steve, there is no such version.

LonkeroAdministrator
(KiX Master Guru)
2002-12-02 07:58 PM
Re: INGROUP problem

kent, what is difference between your and his code? [Confused]

steve, is this new group, have you tried running kix /f

first?


Steve M
(Fresh Scripter)
2002-12-02 08:47 PM
Re: INGROUP problem

It is a new group I setup last week. and inserted the line in this mornings script. Where is it that I insert the line kix /f ????

The version of kix is 3.61.1.0
My other lines of code for ingroup works fine
see below my code
code:
 SHELL "winset.exe USERNAME=@USERID"
BREAK ON ;(re)set Ctrl-C/Break handling
COLOR r+/n

;
CLS
;
small
Color b+/n
BOX (7,20,17,61,FULL)
;
Color w+/n
;
IF ((@time > "00:00:00") AND (@time < "12:00:00"))
at (9,22) "Good Morning,"
ELSE
IF ((@time >= "12:00:00") AND (@time < "18:00:00"))
at (9,22) "Good Afternoon,"
ELSE
at (9,22) "Good Evening,"
ENDIF
ENDIF
;
at (10,22) @fullname
at (12,22) "Please Wait For Logon script Execution"
at (13,22) "Progress"

$drive="\\FS2\"+@userid+chr(36)
USE U: $drive
SLEEP 5

DelKey("HKEY_CURRENT_USER\Software\KiXtart\TokenCache")



if INGROUP("ESCROW-REO")
USE S: /delete /Persistent
use S: "\\FS2\REO$"
? "Member of ESCROW-REO group"
ENDIF


if INGROUP("ESCROW-UNIT1")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT1$"
? "Member of ESCROW-UNIT1 group"
ENDIF


if INGROUP("ESCROW-UNIT2")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT2$"
? "Member of ESCROW-UNIT2 group"
ENDIF


if INGROUP("ESCROW-UNIT3")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT3$"
? "Member of ESCROW-UNIT3 group"
ENDIF


if INGROUP("ESCROW-UNIT4")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT4$"
? "Member of ESCROW-UNIT4 group"
ENDIF

if INGROUP("ESCROW-UNIT5")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT5$"
? "Member of ESCROW-UNIT5 group"
ENDIF

if INGROUP("Everyone")
? "Member of Everyone group"
USE I: /delete /Persistent
use I: "\\FS2\APPS"
If Exist ("c:\windows\RD.bat") = 0
If Exist ("c:\windows\RD.pif") = 0
If Exist ("c:\windows\MSTSc.exe") = 0
If Exist ("c:\windows\MSTSCAX.DLL") = 0
copy "\\W2K2\netlogon\RD.BAT" "c:\windows"
copy "\\W2K2\netlogon\RD.PIF" "c:\windows"
copy "\\W2K2\netlogon\MSTSC.EXE" "c:\windows"
copy "\\W2K2\netlogon\MSTSCAX.DLL" "c:\windows"
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF

if INGROUP("LED")
? "Member of LED group"
USE G: /delete /Persistent
use G: "\\ATC-CORP\VOL2"
USE S: /delete /Persistent
use S: "\\FS2\LED$"
If Exist ("c:\windows\DESKTOP\TRAKKE~1.PIF") = 0
copy "\\W2K2\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop
If Exist ("c:\windows\DESKTOP\TRAKKE~2.PIF") = 0
copy "\\W2K2\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop
If Exist ("c:\windows\DESKTOP\STARDO~1.PIF") = 0
copy "\\W2K2\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop
endif
endif
endif
endif

if INGROUP("REALEC")
USE R: /DEL /PERSISTENT
use R: "\\FS1\REALEC"
? "Member of REALEC group"
endif
sleep 5

if INGROUP("TRAKKER")
USE L: /delete /Persistent
use L: "\\TK2\TRAKKER"
? "Member of Trakker group"
ENDIF
sleep 5

;if INGROUP("USBANK")
;USE I: /delete /Persistent
;use I: "\\FS2\Apps"
;? "Member of USBANK group"
;USE U: /delete /Persistent
;USE H: $drive
;endif

;if INGROUP("LANEGUIDE")
;USE I: /delete /Persistent
;use I: "\\FS1\LANE GUIDE"
;? "Member of LANEGUIDE group"
;endif


if INGROUP("Domain Admins")
? "Member of Domain Admins group"
sleep 5
USE G: /delete /Persistent
use G: "\\ATC-CORP\VOL2"
USE L: /delete /Persistent
use L: "\\TK2\TRAKKER"
If Exist ("c:\windows\DESKTOP\TRAKKE~1.PIF") = 0 ;Checks for the existance of Trakker Star shortcut
If Exist ("c:\windows\DESKTOP\TRAKKE~2.PIF") = 0 ;Checks for the existance of Trakker Lend shortcut
If Exist ("c:\windows\DESKTOP\ESCROW~1.PIF") = 0 ;Checks for the existance of Escrow Docnet shortcut
If Exist ("c:\windows\DESKTOP\REOESC~1.PIF") = 0 ;Checks for the existance of Reo Escrow Docnet shortcut
If Exist ("c:\windows\DESKTOP\STARDO~1.PIF") = 0 ;Checks for the existance of Star Docnet shortcut

copy "\\W2K2\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop
copy "\\W2K2\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop
copy "\\W2K2\netlogon\ESCROW~1.PIF" "c:\windows\desktop" ;copies Escrow Docnet shortcut to desktop
copy "\\W2K2\netlogon\REOESC~1.PIF" "c:\windows\desktop" ;copies Reo Escrow Docnet shortcut to desktop
copy "\\W2K2\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF





Sealeopard
(KiX Master)
2002-12-02 08:51 PM
Re: INGROUP problem

Oh man, an completely outdated KiXtart version with tons of incorrect IF-ENDIFs. Please read the KiXtart Manual under IF-ENDIF and correct your IF clauses accordingly, they are definitely incorrect. Each IF requres an corresponding ENDIF and should not be nested unless the nesting is required for the check of specific conditions.

Please rewrite your code and use indenting to highlight blocks of code, this will make it easier. And clean up those IFs! Most likely your problem is with that nesting.

The /f parameter is new in KiXtart 4.x and thus irrelevant for you.

[ 02. December 2002, 20:53: Message edited by: sealeopard ]


LonkeroAdministrator
(KiX Master Guru)
2002-12-02 08:53 PM
Re: INGROUP problem

heh [Big Grin]
I didn't know that:
kixtart 4.1 = 3.61 [Eek!]


LonkeroAdministrator
(KiX Master Guru)
2002-12-02 09:04 PM
Re: INGROUP problem

jens, didn't see any incorrect endifs, where are they?

Sealeopard
(KiX Master)
2002-12-02 09:08 PM
Re: INGROUP problem

Quick glance gave me five IF EXIST in a row, then copying the files, definitely a logic error in the programming code. Haven't taken a closer look at the top part, too hard to read/decipher with a quick glance.

Maybe that code should be sent through the KiXStrip utility to find out what's wrong.


LonkeroAdministrator
(KiX Master Guru)
2002-12-02 09:16 PM
Re: INGROUP problem

logical maybe but quickly checking with my parser (in head) found no structural error from if-endif

ran it with kixstrip and no errors.
here is result:
code:
 SHELL "winset.exe USERNAME=@USERID"
BREAK ON ;(re)set Ctrl-C/Break handling
COLOR r+/n

;
CLS
;
SMALL
COLOR b+/n
BOX (7,20,17,61,FULL)
;
COLOR w+/n
;
IF ((@time > "00:00:00") AND (@time < "12:00:00"))
at (9,22) "Good Morning,"
ELSE
IF ((@time >= "12:00:00") AND (@time < "18:00:00"))
at (9,22) "Good Afternoon,"
ELSE
at (9,22) "Good Evening,"
ENDIF
ENDIF
;
at (10,22) @fullname
at (12,22) "Please Wait For Logon script Execution"
at (13,22) "Progress"

$drive="\\FS2\"+@userid+chr(36)
USE U: $drive
SLEEP 5

DelKey("HKEY_CURRENT_USER\Software\KiXtart\TokenCache")



IF INGROUP("ESCROW-REO")
USE S: /delete /persistent
USE S: "\\FS2\REO$"
? "Member of ESCROW-REO group"
ENDIF


IF INGROUP("ESCROW-UNIT1")
USE S: /delete /persistent
USE S: "\\FS2\ESCROW-UNIT1$"
? "Member of ESCROW-UNIT1 group"
ENDIF


IF INGROUP("ESCROW-UNIT2")
USE S: /delete /persistent
USE S: "\\FS2\ESCROW-UNIT2$"
? "Member of ESCROW-UNIT2 group"
ENDIF


IF INGROUP("ESCROW-UNIT3")
USE S: /delete /persistent
USE S: "\\FS2\ESCROW-UNIT3$"
? "Member of ESCROW-UNIT3 group"
ENDIF


IF INGROUP("ESCROW-UNIT4")
USE S: /delete /persistent
USE S: "\\FS2\ESCROW-UNIT4$"
? "Member of ESCROW-UNIT4 group"
ENDIF

IF INGROUP("ESCROW-UNIT5")
USE S: /delete /persistent
USE S: "\\FS2\ESCROW-UNIT5$"
? "Member of ESCROW-UNIT5 group"
ENDIF

IF INGROUP("Everyone")
? "Member of Everyone group"
USE I: /delete /persistent
USE I: "\\FS2\APPS"
IF Exist ("c:\windows\RD.bat") = 0
IF Exist ("c:\windows\RD.pif") = 0
IF Exist ("c:\windows\MSTSc.exe") = 0
IF Exist ("c:\windows\MSTSCAX.DLL") = 0
COPY "\\W2K2\netlogon\RD.BAT" "c:\windows"
COPY "\\W2K2\netlogon\RD.PIF" "c:\windows"
COPY "\\W2K2\netlogon\MSTSC.EXE" "c:\windows"
COPY "\\W2K2\netlogon\MSTSCAX.DLL" "c:\windows"
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF

IF INGROUP("LED")
? "Member of LED group"
USE G: /delete /persistent
USE G: "\\ATC-CORP\VOL2"
USE S: /delete /persistent
USE S: "\\FS2\LED$"
IF Exist ("c:\windows\DESKTOP\TRAKKE~1.PIF") = 0
COPY "\\W2K2\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop
IF Exist ("c:\windows\DESKTOP\TRAKKE~2.PIF") = 0
COPY "\\W2K2\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop
IF Exist ("c:\windows\DESKTOP\STARDO~1.PIF") = 0
COPY "\\W2K2\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop
ENDIF
ENDIF
ENDIF
ENDIF

IF INGROUP("REALEC")
USE R: /del /persistent
USE R: "\\FS1\REALEC"
? "Member of REALEC group"
ENDIF
SLEEP 5

IF INGROUP("TRAKKER")
USE L: /delete /persistent
USE L: "\\TK2\TRAKKER"
? "Member of Trakker group"
ENDIF
SLEEP 5

;if INGROUP("USBANK")
;USE I: /delete /Persistent
;use I: "\\FS2\Apps"
;? "Member of USBANK group"
;USE U: /delete /Persistent
;USE H: $drive
;endif

;if INGROUP("LANEGUIDE")
;USE I: /delete /Persistent
;use I: "\\FS1\LANE GUIDE"
;? "Member of LANEGUIDE group"
;endif


IF INGROUP("Domain Admins")
? "Member of Domain Admins group"
SLEEP 5
USE G: /delete /persistent
USE G: "\\ATC-CORP\VOL2"
USE L: /delete /persistent
USE L: "\\TK2\TRAKKER"
IF Exist ("c:\windows\DESKTOP\TRAKKE~1.PIF") = 0 ;Checks for the existance of Trakker Star shortcut
IF Exist ("c:\windows\DESKTOP\TRAKKE~2.PIF") = 0 ;Checks for the existance of Trakker Lend shortcut
IF Exist ("c:\windows\DESKTOP\ESCROW~1.PIF") = 0 ;Checks for the existance of Escrow Docnet shortcut
IF Exist ("c:\windows\DESKTOP\REOESC~1.PIF") = 0 ;Checks for the existance of Reo Escrow Docnet shortcut
IF Exist ("c:\windows\DESKTOP\STARDO~1.PIF") = 0 ;Checks for the existance of Star Docnet shortcut

COPY "\\W2K2\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop
COPY "\\W2K2\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop
COPY "\\W2K2\netlogon\ESCROW~1.PIF" "c:\windows\desktop" ;copies Escrow Docnet shortcut to desktop
COPY "\\W2K2\netlogon\REOESC~1.PIF" "c:\windows\desktop" ;copies Reo Escrow Docnet shortcut to desktop
COPY "\\W2K2\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF


;($begin)
;
; mon 02-dec-2002 22:19:31 (kix 4.10 vs 3.20e)
;
;Informative KIXSTRIP: no errors found (input=164 output=164 skip=0).
;
;Informative KIXSTRIP: 25 block_structures found.
;Informative KIXSTRIP: no UDF's found.
;Informative KIXSTRIP: no labels found.
;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE
;Informative KIXSTRIP: 1 BREAK
;Informative KIXSTRIP: 1 SHELL
;Informative KIXSTRIP: 4 SLEEP
;Informative KIXSTRIP: 27 USE
;
;($end)



Steve M
(Fresh Scripter)
2002-12-03 06:11 AM
Re: INGROUP problem

In conclusion, is there a reason why I cannot map the REALEC group members to "R"?

LonkeroAdministrator
(KiX Master Guru)
2002-12-03 06:18 AM
Re: INGROUP problem

can't quickly think of any.
anyway, place error-checks after each line in that if-endif.
this way you... we can see what is the error kixtart is facing.


Kdyer
(KiX Supporter)
2002-12-03 06:20 AM
Re: INGROUP problem

Got a question...

Does the Group - "REALEC" have permissions applied for where you are sharing the R: Drive to?

Kent

[ 03. December 2002, 06:21: Message edited by: kdyer ]


Steve M
(Fresh Scripter)
2002-12-03 06:47 AM
Re: INGROUP problem

Yes it does have the permissions. I can even do a net use R: \\FS1\REALEC in the command window and it maps to it.

NTDOCAdministrator
(KiX Master)
2002-12-03 07:23 AM
Re: INGROUP problem

Steve,

How about just doing a simple script to verify if in fact it is working correctly.

Try just creating a TEST.KIX file and put in.

code:
use R: "\\FS1\REALEC"

Maybe try with and without the quotes " "

Then run from a DOS box.

C:\TEMP\KIX32.EXE C:\TEMP\TEST.KIX (or whatever path you use for this test).


LonkeroAdministrator
(KiX Master Guru)
2002-12-03 08:37 AM
Re: INGROUP problem

I would check the ingroup...

Kdyer
(KiX Supporter)
2002-12-03 08:40 AM
Re: INGROUP problem

This reminds me of something...

Is "REALC" in proper case? Are you sure it is not "Realc" or "realc"?

As I remember, there was something about INGROUP being case-sensitive.

Kent


LonkeroAdministrator
(KiX Master Guru)
2002-12-03 08:42 AM
Re: INGROUP problem

[Confused]

kidding?


Kdyer
(KiX Supporter)
2002-12-03 08:43 AM
Re: INGROUP problem

Actually.. No.. I have tested this..

Now, watch and this will come back and bite me. [Embarrassed]

Kent

[ 03. December 2002, 08:43: Message edited by: kdyer ]


Steve M
(Fresh Scripter)
2002-12-03 03:06 PM
Re: INGROUP problem

I tried what NTDOC suggested as a test and it mapped. Now this proves that it is not a permissions issue or a typo in my script. The issue is the group enumeration. Can anyone tell me why other ingroups work for me except for REALEC????

Kdyer
(KiX Supporter)
2002-12-03 03:17 PM
Re: INGROUP problem

Steve,

Does it exist when you execute the following script (List all groups on the domain)?
code:
$DomainString = "DOMAINNAME"
$DomainObj = GetObject("WinNT://" + $DomainString)
$DomainObj.Filter = Array("group")

For Each $GroupObj In $DomainObj
If $GroupObj.Class = "Group"
$List = $List + $GroupObj.Name + @crlf
EndIf

Next

?$List
$DomainObj = 0
$GroupObj = 0

Or, list groups of a user..
code:
$DomainString="ComputerName"
$UserString = "jdoe"

$UserObj = GetObject("WinNT://" + $DomainString + "/" + $UserString)

For Each $GroupObj In $UserObj.Groups
$List = $List + $GroupObj.Name + @crlf
Next

?List

$UserObj = 0
$GroupObj = 0

HTH,

Kent

[ 03. December 2002, 16:15: Message edited by: kdyer ]


Sealeopard
(KiX Master)
2002-12-03 03:18 PM
Re: INGROUP problem

Have you tried the case-sensitivity issue?

Alternatively, write a test script that enumerates the groups a user is a member of and user on a user in the offending group. See how the group name is being returned and potentially adjust the spelling. See the ENUMGROUP() function in the KiXtart Manual for an example.


Les
(KiX Master)
2002-12-03 03:22 PM
Re: INGROUP problem

Have you tried using a newer version of KiX? Are you still struggling with 3.x?

Les
(KiX Master)
2002-12-03 03:25 PM
Re: INGROUP problem

Guys,
ADSI and UDFs are of little value if "The version of kix is 3.61.1.0".


GRF
(Fresh Scripter)
2002-12-03 03:48 PM
Re: INGROUP problem

Maybe try it with a different drive letter.

Kdyer
(KiX Supporter)
2002-12-03 04:14 PM
Re: INGROUP problem

OK..

If this is KiXtart 3.61.

More questions...

Does this new group exist on all DCs? Have replication partners been setup?

Maybe try the code that I posted for checking the groups by downloading Kix 4.12 and running locally to test the results for ADSI.

HTH,

Kent


Les
(KiX Master)
2002-12-03 04:22 PM
Re: INGROUP problem

One also has to wonder if this is an NT4 domain or Active Directory. Also then what type of group?

Kdyer
(KiX Supporter)
2002-12-03 04:41 PM
Re: INGROUP problem

Steve,

Further to Les' question:

Is this a Domain Local, Global, or Universal Group?

Thanks,

Kent


Steve M
(Fresh Scripter)
2002-12-03 05:03 PM
Re: INGROUP problem

It is global just like the other ones. I even gave that user it's own logon1.bat which calls a stripped down code and it only maps L: and enumerates that the user is a member of TRAKKER.
code:
SHELL "winset.exe USERNAME=@USERID"
BREAK ON ;(re)set Ctrl-C/Break handling
COLOR r+/n

;
CLS
;
small
Color b+/n
BOX (7,20,17,61,FULL)
;
Color w+/n
;
IF ((@time > "00:00:00") AND (@time < "12:00:00"))
at (9,22) "Good Morning,"
ELSE
IF ((@time >= "12:00:00") AND (@time < "18:00:00"))
at (9,22) "Good Afternoon,"
ELSE
at (9,22) "Good Evening,"
ENDIF
ENDIF
;
at (10,22) @fullname
at (12,22) "Please Wait For Logon script Execution"
at (13,22) "Progress"

$drive="\\FS2\"+@userid+chr(36)
USE U: $drive
SLEEP 5

DelKey("HKEY_CURRENT_USER\Software\KiXtart\TokenCache")




if INGROUP("RealEC")
USE R: /delete /Persistent
USE R: "\\FS1\RealEC"
? "Member of RealEC group"
endif
sleep 5

if INGROUP("TRAKKER")
USE L: /delete /Persistent
use L: "\\TK2\TRAKKER"
? "Member of Trakker group"
ENDIF
sleep 5



Sealeopard
(KiX Master)
2002-12-03 06:27 PM
Re: INGROUP problem

The Token Cache should not even exist under KiXtart 3.6x since it was only added in KiXtart 4.x

Can you do a slightly different experiment and run the same code with both KiXtart 3.6x and 4.12 and see whether there is any difference?

Also use ENUMGROUP() (see KiXtart Manual for example) to enumerate the group membershisp and see whether there's anything unusual.

[ 03. December 2002, 18:29: Message edited by: sealeopard ]


NTDOCAdministrator
(KiX Master)
2002-12-03 09:37 PM
Re: INGROUP problem

Les,

He stated:
quote:
I am using 4.1 version if that helps
So we know he is using a new enough version to use UDFs etc...

Steve,

Try running your script from the DOS box but like this:

C:\TEMP\KIX32.EXE C:\TEMP\MYTEST.KIX /F

The /F will force KiXtart to renew the token cache.

From the manual:
quote:
Group-membership information cache.
As both methods of retrieving the group-membership are relatively costly in terms of network traffic and process time the latest update of KiXtart caches the group-membership information in the registry. This means that once the cache is filled, subsequent runs of KIX32.EXE will require much less time to retrieve the group-membership information.

The group-membership cache is stored in the registry hive of the current user and contains security-identifier-to-groupname mappings. Changes to a user's group-membership are automatically handled by KiXtart during the next logon.

Note
If an existing group is renamed, that change will not be visible to KiXtart until the next time the token-cache is refreshed.

The cache is automatically refreshed every 30 days.

A refresh of the cache can also be forced using the new '/f' commandline option:

KIX32 /f

Optionally, you can include a date, indicating how old the cache must be for it to be refreshed:

KIX32 /f:2001/12/31

Note
The group-membership cache feature of KiXtart is only available on Windows NT or higher.



Sealeopard
(KiX Master)
2002-12-03 09:39 PM
Re: INGROUP problem

However, further down inthe thread, Steve states that he is using KiXtart 3.61 as identified by the KiXtart executable version.

NTDOCAdministrator
(KiX Master)
2002-12-03 09:44 PM
Re: INGROUP problem

Hmm.. Okay SORRY! I missed that.

FDISK, FORMAT C: /S should fix it as well [Eek!]


Steve M
(Fresh Scripter)
2002-12-04 12:45 AM
Re: INGROUP problem

Something interesting if it will help you all resolve my issue. Today I created a new global group and a hiden share on the server. I put both new users created yesterday into this group and added the code and they map no problem. Below is the code,
code:
 if INGROUP("ESCROW-UNIT6")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT6$"
? "Member of ESCROW-UNIT6 group"
ENDIF



Howard Bullock
(KiX Supporter)
2002-12-04 12:47 AM
Re: INGROUP problem

Have you migrated from NT4 to W2K AD using Sid history?

Kdyer
(KiX Supporter)
2002-12-04 12:48 AM
Re: INGROUP problem

OK..

So, why not create a group called REALC1 and try the script?

Or.. Delete the "REALC" group.. Let replication occur and create it to try it again?

Kent


Steve M
(Fresh Scripter)
2002-12-04 03:17 AM
Re: INGROUP problem

We been on win2k ad for a long time. Kix was implemented about 3 months now

Kdyer
(KiX Supporter)
2002-12-04 03:19 AM
Re: INGROUP problem

Steve,

I think what Howard and I are trying to drive at is there maybe some corruption in the SID for this new group you created last week.

Kent


Steve M
(Fresh Scripter)
2002-12-04 05:47 AM
Re: INGROUP problem

I created a REALEC1 group and added that to the the script and no result. So sid corruption it is not.

Howard Bullock
(KiX Supporter)
2002-12-04 06:40 AM
Re: INGROUP problem

Get my GrpMaint.exe from my web site. Enumerate the members of the group:
code:
Grpmaint --enum --sam \\servername --Global --name REALEC1 --outfile grp.txt  

You may want try this command against all your DCs to verify the the group replication has taken place. Are all the results as you would expect?

What versions of KiXtart have you tried? I recommend that you use 4.02 or 4.12.

There has to be a logical explanation but you will have to apply a disciplined approach to troubleshooting this issue. We will have to move one step at a time.

[ 04. December 2002, 14:21: Message edited by: Howard Bullock ]


NTDOCAdministrator
(KiX Master)
2002-12-04 09:23 AM
Re: INGROUP problem

Steve,

Maybe I missed it here in the thread somewhere, but is this Windows NT 4.0 or 2000 AD?

Is it Single Master Domain model or other?

Thanks for replying with this info again if you've already supplied that.

As Howard says, it can be nailed down, but will require specific step by step analysis.


Kdyer
(KiX Supporter)
2002-12-04 02:31 PM
Re: INGROUP problem

Steve,

As an alternative to Howard's utility..
code:
 BREAK ON
$domainstring = "DOMAINNAME"
$GroupString = "REALC1"
$GroupObj = GetObject("WinNT://" + $DomainString + "/" + $GroupString)
IF EXIST("H:\USERLIST.CSV")
DEL "H:\USERLIST.CSV"
ENDIF
IF Open( 3 , "H:\USERLIST.CSV" , 5 ) = 0
$hdr = "GROUPNAME"
$x = WriteLine( 3 , $hdr + @crlf)
For each $UserObj in $GroupObj.Members
$List = $List + $UserObj.Name
Next
$x = WriteLine( 3 , $list + @crlf)
?$list + @crlf
$x = CLOSE(3)
ENDIF

$groupobj = 0
?"Process is complete.."
SLEEP 2

You can use this to check and write the group list to a log from the domain:
code:
 BREAK ON
$domainstring = "DOMAINNAME"
$domainobj = GetObject("WinNT://" + $domainstring)
$domainobj.filter = Array("group")
IF EXIST("H:\GRPLIST.CSV")
DEL "H:\GRPLIST.CSV"
ENDIF
IF Open( 3 , "H:\GRPLIST.CSV" , 5 ) = 0
$hdr = "GROUPNAME"
$x = WriteLine( 3 , $hdr + @crlf)
FOR EACH $groupobj IN $domainobj
IF $groupobj.class = "Group"
$list = $list + $groupobj.name
ENDIF
NEXT
$x = WriteLine( 3 , $list + @crlf)
?$list + @crlf
$x = CLOSE(3)
ENDIF

$domainobj = 0
?"Process is complete.."
SLEEP 2

Or.. Groups of a user:

code:
 BREAK ON
$domainstring="ComputerName"
$userstring = "jdoe"
$userobj = GetObject("WinNT://" + $domainstring + "/" + $userstring)
IF EXIST("H:\PGRP.CSV")
DEL "H:\PGRP.CSV"
ENDIF
IF Open( 3 , "H:\PGRP.CSV" , 5 ) = 0
$hdr = "GROUPNAME"
$x = WriteLine( 3 , $hdr + @crlf)
FOR EACH $groupobj IN $userobj.groups
$list = $list + $groupobj.name
NEXT
$x = WriteLine( 3 , $list + @crlf)
?$list + @crlf
$x = CLOSE(3)
ENDIF

$userobj = 0
?"Process is complete.."
SLEEP 2

HTH,

Kent

[ 04. December 2002, 14:37: Message edited by: kdyer ]


Howard Bullock
(KiX Supporter)
2002-12-04 02:45 PM
Re: INGROUP problem

Kent the reason I suggested using GrpMaint was that if this is W2K AD and he has replication intervals set too high then he may actually be creating the group on one DC and the client may be query a different DC. GrpMaint can easily check the group on each server. I would not want to troubleshoot this problem by connecting to the domain because we do not know for sure which server is being enumerated.

[ 04. December 2002, 14:48: Message edited by: Howard Bullock ]


Steve M
(Fresh Scripter)
2002-12-04 02:52 PM
Re: INGROUP problem

This is interesting, I put a ; infront of the ifingroup which means this should apply to everyone globaly and it did not map
code:
 ;if INGROUP("RealEC")
USE R: /delete /Persistent
USE R: "\\FS1\RealEC"
? "Member of RealEC group"
endif



Les
(KiX Master)
2002-12-04 03:05 PM
Re: INGROUP problem

Steve,
If you comment out the IF you also MUST comment out the ENDIF!

Are you still messing with KiX 3.61? Download 4.12 and try a test script with just the IF INGROUP().


Steve M
(Fresh Scripter)
2002-12-04 04:42 PM
Re: INGROUP problem

If I try 4.12 do I have to replace the kxrpc service on the server also?

Sealeopard
(KiX Master)
2002-12-04 04:54 PM
Re: INGROUP problem

Only if you support Windows 9x computers. During testing you won't need to do anything. Additionally, there's a batch file in the KiXtart distribution that enables you to remotely update the KiXtart RPC Server. Installing/updating the KiXtart RPC Server does not require a reboot of the server.

[ 04. December 2002, 17:21: Message edited by: sealeopard ]


GRF
(Fresh Scripter)
2002-12-04 04:58 PM
Re: INGROUP problem

Maybe it doesn't like the R:. Try using S:.

Sealeopard
(KiX Master)
2002-12-04 05:07 PM
Re: INGROUP problem

What are the associated error codes?
Try
code:
if ingroup('groupname')
use r: \delete
? 'Error '+@ERROR+' - '+@SERROR
use r: '\\server\share'
? 'Error '+@ERROR+' - '+@SERROR
endif



LonkeroAdministrator
(KiX Master Guru)
2002-12-04 05:15 PM
Re: INGROUP problem

steve, have you a problem of just checking the error?

I think I've before asked that too.
we can't keep on quessing for years, we need help from you too, please.

do try:
code:
if INGROUP("RealEC")
? "Member of RealEC group"
USE R: /delete /Persistent
USE R: "\\FS1\RealEC"
if @error
? "MAPPING ERROR: @error"
? "press any key to continue"
get $somekey
endif
else
? "not Member of RealEC group"

endif



LonkeroAdministrator
(KiX Master Guru)
2002-12-04 05:18 PM
Re: INGROUP problem

jens was faster [Wink]

Kdyer
(KiX Supporter)
2002-12-04 05:19 PM
Re: INGROUP problem

Just a sec..

I think Jens may have hit the nail on the head.

quote:

Only if you support Windows 9x computers. During testing you won't need to do anything. Additionally, there's a batch file in the KiXtart distribution that enables you to remotely update the KiXtart RPC Server. Installing/updating the KiXtart RPC SErver does not require a reboot fo the server.

Is this 9x you are having trouble with?

Kent


LonkeroAdministrator
(KiX Master Guru)
2002-12-04 05:21 PM
Re: INGROUP problem

kent, yes I think so, but the ingroup does not need rpc... at least not in kix95

Sealeopard
(KiX Master)
2002-12-04 05:24 PM
Re: INGROUP problem

To be honest, I've lost track of the problem after all those posts. The initial INGROUP problem sounds like a very basic problem. Ten minutes of checking the KiXtart distribution (file versions, etc.) and using a little test script should solve the problem, especially when using the @ERROR functions.

I can't help but wonder why Steve doesn't perform those very basic checks.


Les
(KiX Master)
2002-12-04 05:25 PM
Re: INGROUP problem

Jooel, I beg to differ. InGroup() is needed for Wintendos.

Back to KiX version. 3.61 is too old for AD so it makes sense to upgrade. Not to mentiopn the features and performance boost.


Steve M
(Fresh Scripter)
2002-12-04 05:32 PM
Re: INGROUP problem

Looking at my netlogon directory the kx95.dll is version 3.60 and the kix I downloaded this morning 4.12 has kx95.dll version 4.1.0.0 the kx32.dll is the same verion 3.61.1.0 as I am running in my netlogon
Kix32.exe in my netlogon is 4.11.0.0 In conclusion the only files I need to replace on my netlogon would be the kix32.exe and kx95.dll am I correct assuming this?


Les
(KiX Master)
2002-12-04 05:34 PM
Re: INGROUP problem

According to Ruud, if you replace one you have to replace them all.

LonkeroAdministrator
(KiX Master Guru)
2002-12-04 05:36 PM
Re: INGROUP problem

steve, you should also be sure that local machines have no different versions of those files.

Sealeopard
(KiX Master)
2002-12-04 05:37 PM
Re: INGROUP problem

You must update the KiXtart RPC Server service if you want to use KiXtart 4.12 while supporting Windows 9x computers. Changes have been made to both the RPC service and the associated Windows 9x DLLs that require this update.

Additionally, use any of the LOGIN.BAT batch files that have been posted in other threads to ensure that all clients have up-to-date client files.

[ 04. December 2002, 17:39: Message edited by: sealeopard ]


Steve M
(Fresh Scripter)
2002-12-04 05:47 PM
Re: INGROUP problem

LONKERO,
I have added your debug code and it did not display any thing or ask me to hit any key. Below is my most recent code. And yes I am using kix to support win98 clients only. My win2k clients use native AD GPO
code:
 SHELL "winset.exe USERNAME=@USERID"
BREAK ON ;(re)set Ctrl-C/Break handling
COLOR r+/n

;
CLS
;
small
Color b+/n
BOX (7,20,17,61,FULL)
;
Color w+/n
;
IF ((@time > "00:00:00") AND (@time < "12:00:00"))
at (9,22) "Good Morning,"
ELSE
IF ((@time >= "12:00:00") AND (@time < "18:00:00"))
at (9,22) "Good Afternoon,"
ELSE
at (9,22) "Good Evening,"
ENDIF
ENDIF
;
at (10,22) @fullname
at (12,22) "Please Wait For Logon script Execution"
at (13,22) "Progress"

$drive="\\FS2\"+@userid+chr(36)
USE U: $drive
SLEEP 5

DelKey("HKEY_CURRENT_USER\Software\KiXtart\TokenCache")



if INGROUP("ESCROW-REO")
USE S: /delete /Persistent
use S: "\\FS2\REO$"
? "Member of ESCROW-REO group"
ENDIF


if INGROUP("ESCROW-UNIT1")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT1$"
? "Member of ESCROW-UNIT1 group"
ENDIF


if INGROUP("ESCROW-UNIT2")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT2$"
? "Member of ESCROW-UNIT2 group"
ENDIF


if INGROUP("ESCROW-UNIT3")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT3$"
? "Member of ESCROW-UNIT3 group"
ENDIF


if INGROUP("ESCROW-UNIT4")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT4$"
? "Member of ESCROW-UNIT4 group"
ENDIF

if INGROUP("ESCROW-UNIT5")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT5$"
? "Member of ESCROW-UNIT5 group"
ENDIF

if INGROUP("ESCROW-UNIT6")
USE S: /delete /Persistent
use S: "\\FS2\ESCROW-UNIT6$"
? "Member of ESCROW-UNIT6 group"
ENDIF

USE I: /delete /Persistent
use I: "\\FS2\APPS"
If Exist ("c:\windows\RD.bat") = 0
copy "\\W2K2\netlogon\RD.BAT" "c:\windows"
Endif
If Exist ("c:\windows\RD.pif") = 0
copy "\\W2K2\netlogon\RD.PIF" "c:\windows"
Endif
If Exist ("c:\windows\MSTSc.exe") = 0
copy "\\W2K2\netlogon\MSTSC.EXE" "c:\windows"
Endif
If Exist ("c:\windows\MSTSCAX.DLL") = 0
copy "\\W2K2\netlogon\MSTSCAX.DLL" "c:\windows"
Endif

if INGROUP("LED")
? "Member of LED group"
USE G: /delete /Persistent
use G: "\\ATC-CORP\VOL2"
USE S: /delete /Persistent
use S: "\\FS2\LED$"
If Exist ("c:\windows\DESKTOP\TRAKKE~1.PIF") = 0
copy "\\W2K2\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop
Endif
If Exist ("c:\windows\DESKTOP\TRAKKE~2.PIF") = 0
copy "\\W2K2\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop
Endif
If Exist ("c:\windows\DESKTOP\STARDO~1.PIF") = 0
copy "\\W2K2\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop
Endif

if INGROUP("RealEC")
? "Member of RealEC group"
USE R: /delete /Persistent
USE R: "\\FS1\RealEC"
if @error
? "MAPPING ERROR: @error"
? "press any key to continue"
get $somekey
endif
else
? "not Member of RealEC group"
endif



if INGROUP("TRAKKER")
USE L: /delete /Persistent
use L: "\\TK2\TRAKKER"
? "Member of Trakker group"
ENDIF
sleep 5


if INGROUP("Domain Admins")
? "Member of Domain Admins group"
sleep 5
USE G: /delete /Persistent
use G: "\\ATC-CORP\VOL2"
USE L: /delete /Persistent
use L: "\\TK2\TRAKKER"
If Exist ("c:\windows\DESKTOP\TRAKKE~1.PIF") = 0 ;Checks for the existance of Trakker Star shortcut
copy "\\W2K2\netlogon\TRAKKE~1.PIF" "c:\windows\desktop" ;copies Trakker Star shortcut to desktop
ENDIF
If Exist ("c:\windows\DESKTOP\TRAKKE~2.PIF") = 0 ;Checks for the existance of Trakker Lend shortcut
copy "\\W2K2\netlogon\TRAKKE~2.PIF" "c:\windows\desktop" ;copies Trakker Lend shortcut to desktop
ENDIF
If Exist ("c:\windows\DESKTOP\ESCROW~1.PIF") = 0 ;Checks for the existance of Escrow Docnet shortcut
copy "\\W2K2\netlogon\ESCROW~1.PIF" "c:\windows\desktop" ;copies Escrow Docnet shortcut to desktop
ENDIF
If Exist ("c:\windows\DESKTOP\REOESC~1.PIF") = 0 ;Checks for the existance of Reo Escrow Docnet shortcut
copy "\\W2K2\netlogon\REOESC~1.PIF" "c:\windows\desktop" ;copies Reo Escrow Docnet shortcut to desktop
ENDIF
If Exist ("c:\windows\DESKTOP\STARDO~1.PIF") = 0 ;Checks for the existance of Star Docnet shortcut
copy "\\W2K2\netlogon\STARDO~1.PIF" "c:\windows\desktop" ;copies Star Docnet shortcut to desktop
ENDIF







Les
(KiX Master)
2002-12-04 05:49 PM
Re: INGROUP problem

Further on the DLLs...

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=2;t=002760

and this one for 4.10
http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=3;t=000313;p=2


Sealeopard
(KiX Master)
2002-12-04 05:52 PM
Re: INGROUP problem

Steve:

Please go back and use a really simple piece of code.
code:
? InGroup status: '+ingroup('groupname')
if ingroup('groupname')
use r: /delete
? 'Error '+@error+' - '+@serror
use r: '\\server\share'
? 'Error '+@error+' - '+@serror
else
? 'User '+@USERID+' is not a member fo this group'
endif
? 'Press any key'
get $a

Please run just this piece of code e.g. from the console while being logged in as a user of the group that is to be tested.

[ 04. December 2002, 17:54: Message edited by: sealeopard ]


GRF
(Fresh Scripter)
2002-12-04 05:54 PM
Re: INGROUP problem

I noticed in your code that the group RealEC is the only group that tries to map to R:. Will one of the existing groups that currently map to another drive letter map to R:?

LonkeroAdministrator
(KiX Master Guru)
2002-12-04 05:56 PM
Re: INGROUP problem

steve, like you have said before, without simplifying your code, you wont get it.

currently, with quick check, you need to be also in group led to get to that check.
as you don't have endif for led before checking with that code.

so, please, try with simpler code.


Steve M
(Fresh Scripter)
2002-12-04 06:45 PM
Re: INGROUP problem

I just tried the simpler code logged in as a user in the command window and it said not member of RealEC. I have also noticed that the L: drive stopped mapping for my users which in my code worked prior to my editing this code. This is an important drive because it runs our main application TRAKKER. WHAT stupid mistake have I done to break this thing?????

Sealeopard
(KiX Master)
2002-12-04 06:47 PM
Re: INGROUP problem

I guess you've found your answer to your problems. The INGROUP commands don't seem to work for you for some reason. You will nee to get the INGROUP working again. Try the same piece of code from a Windows NT/2000/XP machine and see whether it'll work.

[ 04. December 2002, 18:52: Message edited by: sealeopard ]


Steve M
(Fresh Scripter)
2002-12-04 06:55 PM
Re: INGROUP problem

I just put back my backup of my old code and people are now getting their L drive back. I cannot understand why that is because I did not make any changes to the L drive code
code:
 if INGROUP("TRAKKER")
USE L: /delete /Persistent
use L: "\\TK2\TRAKKER"
? "Member of Trakker group"
ENDIF

as you can see it is the same in the new code as it is in the old code.


Howard Bullock
(KiX Supporter)
2002-12-04 06:56 PM
Re: INGROUP problem

Well, it appears that this code doesn't make much sense and it is missing an ENDIF.

code:
if INGROUP("TRAKKER")
USE L: /delete /Persistent
use L: "\\TK2\TRAKKER"
? "Member of Trakker group"
ENDIF
sleep 5


if INGROUP("Domain Admins")
? "Member of Domain Admins group"
sleep 5
USE G: /delete /Persistent
use G: "\\ATC-CORP\VOL2"
USE L: /delete /Persistent
use L: "\\TK2\TRAKKER"



Sealeopard
(KiX Master)
2002-12-04 07:01 PM
Re: INGROUP problem

BTW, Steve, you should test your scripts before deploying them to your users. And please check your script syntax, as missing ENDIFs/NEXT/... can have desastrous results, though part of the script might still work.

[ 04. December 2002, 19:11: Message edited by: sealeopard ]


Waltz
(Seasoned Scripter)
2002-12-04 07:11 PM
Re: INGROUP problem

quote:
;Warning KIXSTRIP: 2 errors in block structure(s). missing statement(s).
; - do:until [0:0]
; - for|each:in|to:step|next [0|0:0|0:0|0]
; - function:endfunction [0:0]
; -ERROR- - if:else:endif [26:3:24]
; - select:case:endselect [0:0:0]
; - while:loop [0:0]
;Warning KIXSTRIP: some lines contains errors or possible errors.