#162863 - 2006-06-05 05:12 AM
InGroup() not working correctly
|
b0r3d
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
|
|
|
|
#162869 - 2006-06-05 06:47 AM
Re: InGroup() not working correctly
|
b0r3d
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
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
|
|
|
|
#162872 - 2006-06-05 07:20 AM
Re: InGroup() not working correctly
|
b0r3d
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
|
|
|
|
#162874 - 2006-06-05 08:19 AM
Re: InGroup() not working correctly
|
NTDOC
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
|
|
|
|
#162876 - 2006-06-06 02:14 AM
Re: InGroup() not working correctly
|
b0r3d
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1574 anonymous users online.
|
|
|