Page 1 of 1 1
Topic Options
#162863 - 2006-06-05 05:12 AM InGroup() not working correctly
b0r3d Offline
Fresh Scripter

Registered: 2006-06-05
Posts: 7
Hi Guys,
I've noticed by searching the forums, that quite a few people have had difficulty with InGroup(), however nobody seems to be having the same problem as me!

I'm starting to recreate all my company's login scripts using kixtart, and moving away from VBS. However, sometimes when i use the InGroup() function, it doesnt recognise the logged in user as being a member of that group.
Here is my setup:

In the login script part of the user details in Active Directory, i'm first calling a batch script, which simply calls the kixscript.

Code:
 
@echo off
@Echo Starting INNOVATIONS Login Script
start /wait kix32.exe \\INNOPARK.AD\NETLOGON\KIX\KIXINNOLOGON.KIX /f



Here's an extract from my kixscript where i'm having the problems:
Code:

; ================================
; = ALL USERS =
; ================================
AT (20,22) " All User Actions"
AT (21,22) "Removing Drives: S,Z"
Use S: /DEL
Use Z: /DEL
Sleep 0.5
GoSub Blank_Line2

;--------------------------
;- MAP DRIVES -
;--------------------------
AT (21,22) "Mapping Drives: S,Z"
Use S: $SDrive
Use Z: $ZDrive
Sleep 0.5
GoSub Blank_Line2

; ================================
; = SPECIFIC USERS =
; ================================

;--------------------------
;- CUSTOMER SERVICE -
;--------------------------
If InGroup ("Customer Service")
GoSub Blank_Line1
AT (20,22) " Customer Service"

; ---- CALL CENTRE ONLY ---
If InGroup("Call Centre")
AT (21,22) "Removing Drive: Q:"
Use Q: /DEL
Sleep 0.5
GoSub Blank_line2

AT (21,22) "Mapping Drive: Q:"
Use Q: $QDrive
Sleep 0.5
GoSub Blank_Line2
EndIf

; ---- ALL OTHER CS STAFF ----
AT (21,22) "Removing Drive: T"
Use T: /DEL
Sleep 0.5
GoSub Blank_line2

AT (21,22) "Mapping Drive: T"
Use T: $TDrive1
Sleep 0.5
GoSub Blank_Line2

; ---- MAP PRINTERS ----
AT (21,22) "Mapping Printers"
If InGroup ("Call Centre")
AddPrinterConnection ($T632CS)
SetDefaultPrinter ($T632CS)
EndIf

If InGroup("CS Team Leaders")
AddPrinterConnection ($T632CSBU)
EndIf

If InGroup("CS Team Players")
AddPrinterConnection ($T632CSBU)
EndIf

If InGroup("CustAdmin")
AddPrinterConnection ($T632DataAdmin)
SetDefaultPrinter ($T632DataAdmin)
EndIf

If InGroup("Data Entry")
AddPrinterConnection ($T632Mailroom)
SetDefaultPrinter ($T632Mailroom)
EndIf

Sleep 0.5
GoSub Blank_Line2

;---- COPY SHORTCUTS ----
Copy $FoxProCS $Desktop /c
Copy $OutlookWeb $Desktop /c

EndIf



It simply won't recognise the user as being a member of the "Customer Service" group, therefor only maps drives S and Z.

In Active Directory, i can assure you that my test user account is a member of "Customer Service" and "Customer Service Team Leaders". However, when I enumerate the groups using the code below, it displays membership for "Customer Service Team Leaders" only. It's very bizzare!

Code:

$Index = 0
Do
$Group = EnumGroup($Index)
? "Member of group: " + $Group
$Index=$Index+1
Until Len($Group) = 0

Sleep 15



Can anyone think of any reason why Kixtart wouldn't be picking up the group membership? Any help what so ever would be greatly appreciated.

Top
#162864 - 2006-06-05 05:35 AM Re: InGroup() not working correctly
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Welcome to the board,


Well 3 things come to mind.

1. Possible the group has been renamed in which case KiXtart may not recognize the new name as being valid.

2. The group name is over 20 characters long
3. The replication of the AD may not be working or may take longer to replicate than you think.
 

Top
#162865 - 2006-06-05 06:00 AM Re: InGroup() not working correctly
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
can throw both of the first ones out the window...
_________________________
!

download KiXnet

Top
#162866 - 2006-06-05 06:11 AM Re: InGroup() not working correctly
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
I can guarantee you that item 2 is a valid concern.

I have personally experienced it, did not bother gathering all the details as to why, but something to do with pre-2000 is or can be involved and cause an issue.

1 yes agree that it shouldn't be an issue, but hey Windows is not always what it should be.

Top
#162867 - 2006-06-05 06:24 AM Re: InGroup() not working correctly
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
DOC,
Count the chars... "Customer Service" does not exceed 20.

b0r3d,
Did you flush the group cache by deleting the reg key?
Are you sure the script is running at all? Maybe the other two drives are persistent.
Is the "Customer Service" group a security group?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#162868 - 2006-06-05 06:30 AM Re: InGroup() not working correctly
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
OK, my mistake - didn't read/count the character, just generalized possiblities.

Still say though that flushing the reg vs calling with /f should achieve the same results.

So far have not seen anyone provide actual proof otherwise.

Top
#162869 - 2006-06-05 06:47 AM Re: InGroup() not working correctly
b0r3d Offline
Fresh Scripter

Registered: 2006-06-05
Posts: 7
I dont think that the number of characters are the issue.
As i said before, "Customer Service Team Leaders" works, but plain ol' "Customer Service" doesnt.

As for the replaction issue, I added the my test account to the group on about Thursday last week (it's Monday now). Im certain that would be long enough for AD to catch up with any changes.

Any other suggestions?

Top
#162870 - 2006-06-05 07:06 AM Re: InGroup() not working correctly
b0r3d Offline
Fresh Scripter

Registered: 2006-06-05
Posts: 7
Quote:

DOC,
Count the chars... "Customer Service" does not exceed 20.

b0r3d,
Did you flush the group cache by deleting the reg key?
Are you sure the script is running at all? Maybe the other two drives are persistent.
Is the "Customer Service" group a security group?




I havent flushed the cache manually. I cant seem to find which registry key contains the information. If you can point me to it, ill delete it and give it another try.

I'm certain the script is running. If i delete the mapped drives before i logoff, open my computer real quick when i login, i can see S & Z being mapped.
Also, if i delete the drives and run the script manually while already logged in, I can see the S & Z map.

Customer Service is a Distribution Group. CS Team Leaders is a Security Group.
I'm guessing they need to be security groups for Kixtart to pick them up?


Edited by b0r3d (2006-06-05 07:10 AM)

Top
#162871 - 2006-06-05 07:14 AM Re: InGroup() not working correctly
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yep.
distribution groups, well, they don't work.
_________________________
!

download KiXnet

Top
#162872 - 2006-06-05 07:20 AM Re: InGroup() not working correctly
b0r3d Offline
Fresh Scripter

Registered: 2006-06-05
Posts: 7
How about any nested groups? Do they need to be security groups also?

For example:

Customer Service (Security Group)
-> CS Temps (Distribution Group)

Will this work for users in the CS Temps group?

Code:

If InGroup("Customer Service")
do stuff
Endif



Edited by b0r3d (2006-06-05 07:21 AM)

Top
#162873 - 2006-06-05 08:17 AM Re: InGroup() not working correctly
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Yes they need to be security groups and yes in general it will (should) pick up membership via nested groups but not the Distribution Groups.
I don't see the reason for placing Distribution Groups within Security Groups. The Distribution are more so for Exchange and not Security management.

There are ways to check a Distribution group, but a bit more code and complications involved.

Much easier to use Security Groups and InGroup


Edited by NTDOC (2006-06-05 08:22 AM)

Top
#162874 - 2006-06-05 08:19 AM Re: InGroup() not working correctly
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Quote:

I added the my test account to the group on about Thursday last week (it's Monday now). Im certain that would be long enough for AD to catch up with any changes.





Well that is being optimistic about it and not technical. If replication is not working it could be 6 months and it still would not show up.

Though this is not the case here, just thought I should mention that guessing about replication and verifying it are different in case someone else comes along and sees this thread and does have a broken replication issue.

Top
#162875 - 2006-06-05 02:41 PM Re: InGroup() not working correctly
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

Hi Guys,
I've noticed by searching the forums...



If you had really searched, you would know what reg key holds the group cache. You would also know that only security groups are supported. You would also have found a UDF that supports distribution groups.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#162876 - 2006-06-06 02:14 AM Re: InGroup() not working correctly
b0r3d Offline
Fresh Scripter

Registered: 2006-06-05
Posts: 7
Wow, so much hostility towards someone simply asking for a little help.

I can assure you Les that I searched the forums, and found nothing relating to my issue. Perhaps my search strings wern't as precice as something you would search for, but believe me i searched.

I only posted this post because I couldnt find anything relating to the problem I was having.

For a moderator of a forum, I would expect you'd be a little more helpful, and a little less pedantic about what i searched for.
The least you could do would be back up your statement with links to the relative posts you described.

Top
#162877 - 2006-06-06 03:12 AM Re: InGroup() not working correctly
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Hostility, no... just defending KiX. InGroup() is sound.

You want links?
Reg key:
http://www.kixtart.org/ubbthreads/showfl...true#Post146679

#2 & 3:
http://www.kixtart.org/ubbthreads/showfl...true#Post162640
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1574 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.134 seconds in which 0.104 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