Page 1 of 2 12>
Topic Options
#200106 - 2010-09-30 12:30 PM Mapping a drive for a group
nige1979 Offline
Fresh Scripter

Registered: 2009-05-14
Posts: 24
Loc: United Kingdom
We use Kixtart and have several scripts that work fine. I have a group of 15 users all in an AD security group called cpheshared that require access to one particular mapped drive. I entered the following into my global login script to call the .kix file....

%LOGONSERVER%\NETLOGON\Kixtart\Kix32.exe %LOGONSERVER%\NETLOGON\Kixtart\mapcphedrive.KIX

In the Kixtart folder i have a file named mapcphedrive.KIX

It contains the following...

;=============================================
;Map Network Drives
;=============================================

If InGroup(“OXFORD\cpheshared”)
Use N: “\\centralx\public\cphe shared”
EndIf

When running the global login script it says the command completed succesfully but no drive appears.... I have also entered this with out the domain name OXFORD in front of the group name and still nothing.

Any ideas...

Top
#200107 - 2010-09-30 02:49 PM Re: Mapping a drive for a group [Re: nige1979]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
First off all you do not relay need a batch file to start the script. You can insert the line in the batch file directly into the user’s properties in AD. I changed the %logonserver% variable to \\domain. This line can be sued in batch and directly in AD. Off course you need to change the domain to match your domain.

 Code:
\\domain\NETLOGON\Kixtart\Kix32.exe \\domain\NETLOGON\Kixtart\mapcphedrive.KIX


You have curly quotes in your script. What do you use to write your scripts? Kix likes the straight quotes better. I also added some debugging code so you can see what is going on.

 Code:
;=============================================
;Map Network Drives
;=============================================

If InGroup("OXFORD\cpheshared")
	Use n: /delete /persistent
	? @ERROR
	? @SERROR
	Use N: "\\centralx\public\cphe shared"
	? @ERROR
	? @SERROR
EndIf

sleep 5


Edited by Mart (2010-09-30 02:54 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200112 - 2010-10-01 01:06 AM Re: Mapping a drive for a group [Re: Mart]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
LOL... those damn curlies... someone should write a FAQ on those.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#200114 - 2010-10-01 08:24 AM Re: Mapping a drive for a group [Re: Mart]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1895
Loc: Hilversum, The Netherlands
 Originally Posted By: Mart
First off all you do not relay need a batch file to start the script.

Eh?


Copying & pasting from HTML will give you curly brackets, most HTML sites have special fonts which present those curly brackets.

Top
#200115 - 2010-10-01 09:47 AM Re: Mapping a drive for a group [Re: Arend_]
nige1979 Offline
Fresh Scripter

Registered: 2009-05-14
Posts: 24
Loc: United Kingdom
Ok so i have amended the global script to have \\OXFORD\NETLOGON\Kixtart\Kix32.exe \\OXFORD\NETLOGON\Kixtart\mapcphedrive.KIX

and it calls the correct script and runs with no errors.... But it doesnt map the drive !!!

 Code:
;=============================================
;Map Network Drives
;=============================================

If InGroup("OXFORD\cpheshared")
	Use n: /delete /persistent
	? @ERROR
	? @SERROR
	Use N: "\\centralx\public\cphe shared"
	? @ERROR
	? @SERROR
EndIf

sleep 5

I am the only member of the security group and the group is call cpheshared.

We use a few KIXTART scripts and they all work fine, so i know our setup is ok and functioning..... Any more ideas ???


Edited by Mart (2010-10-01 10:15 AM)

Top
#200116 - 2010-10-01 10:19 AM Re: Mapping a drive for a group [Re: nige1979]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Do the error codes show on the screen?
It can also be that the kixtart token cache is not 100% up to date. To check this you could add an else case that will start when the user is not a member of the group. This can be fixed by starting kix with the /f parameter or by deleting the registry key below.

 Quote:

HKEY_CURRENT_USER\Software\KiXtart\TokenCache
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200117 - 2010-10-01 10:22 AM Re: Mapping a drive for a group [Re: Arend_]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: apronk
 Originally Posted By: Mart
First off all you do not relay need a batch file to start the script.

Eh?
...



Looks like the op is using a batch file to start his kix script. Unneeded IMHO.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200118 - 2010-10-01 10:30 AM Re: Mapping a drive for a group [Re: Mart]
nige1979 Offline
Fresh Scripter

Registered: 2009-05-14
Posts: 24
Loc: United Kingdom
Our setup is we have three login scripts that run on login. The global login script runs then calls a department script then finally if they have one it calls a personal login script. We would normally just add unique drive mappings to the personal script but in this case the share is on one of our servers in the States and about 30 users need access and this may change quite frequently.

I have entered the line to start the kixscript in the global login script as we have with several other Kixtart scripts.

What do i need to put into my Kixtart script for this "can be fixed by starting kix with the /f parameter or by deleting the registry key below.
" ??

Sorry being dumb :0(

No error codes show on the screen, it does the sleep for 5 secs then closes.

Top
#200119 - 2010-10-01 10:51 AM Re: Mapping a drive for a group [Re: nige1979]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You can just delete the registry key using regedit or start the script like this .....kix32.exe /f ....yourscript.kix.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200120 - 2010-10-01 11:02 AM Re: Mapping a drive for a group [Re: Mart]
nige1979 Offline
Fresh Scripter

Registered: 2009-05-14
Posts: 24
Loc: United Kingdom
Ok i had already deleted the tokencache for KixTart on my local PC. Still has the same issue. Appears to run fine but no mapped drive ??
Top
#200121 - 2010-10-01 12:37 PM Re: Mapping a drive for a group [Re: nige1979]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 686
Loc: Maryland, USA
Can you open a command prompt and map it with "net use ...?" If so, then while still in the command prompt, un-map the share and copy kix32 and the kix script into your local directory. Then, run it:

 Code:
.\kix32 mapcphedrive.KIX


Does that work?

Top
#200123 - 2010-10-01 02:10 PM Re: Mapping a drive for a group [Re: BradV]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Adding an Else to the If - EndIf statement can also help to see if you are actually in the group and if kix also "sees" this.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200127 - 2010-10-01 03:02 PM Re: Mapping a drive for a group [Re: Mart]
nige1979 Offline
Fresh Scripter

Registered: 2009-05-14
Posts: 24
Loc: United Kingdom
Where do i put the ELSE statement to see this
Top
#200129 - 2010-10-01 03:34 PM Re: Mapping a drive for a group [Re: nige1979]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Just after the part that maps the drives but before the EndIf.

 Code:
If InGroup(......)
	;do existing stuff here
Else
	? "Not a member of the target group."
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200131 - 2010-10-01 04:34 PM Re: Mapping a drive for a group [Re: Mart]
nige1979 Offline
Fresh Scripter

Registered: 2009-05-14
Posts: 24
Loc: United Kingdom
ah ok, it comes up saying not a member of the target group...
Top
#200132 - 2010-10-01 06:44 PM Re: Mapping a drive for a group [Re: nige1979]
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
flush your cache....?

kix32 /f

Top
#200133 - 2010-10-01 08:38 PM Re: Mapping a drive for a group [Re: nige1979]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Originally Posted By: nige1979
Ok i had already deleted the tokencache for KixTart on my local PC. Still has the same issue. Appears to run fine but no mapped drive ??
OK, what's in HKEY_CURRENT_USER\Software\KiXtart\TokenCache after you run the script?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#200157 - 2010-10-05 09:26 AM Re: Mapping a drive for a group [Re: Les]
nige1979 Offline
Fresh Scripter

Registered: 2009-05-14
Posts: 24
Loc: United Kingdom
Right if i use the group DOmain Admins this works. But if i change the group toany new local groups it displays. Not a member of the target group (although i am the only member)
Top
#200158 - 2010-10-05 12:08 PM Re: Mapping a drive for a group [Re: nige1979]
nige1979 Offline
Fresh Scripter

Registered: 2009-05-14
Posts: 24
Loc: United Kingdom
Ok, i have looked in the tokencache and the group i am in does not show in the list hence the Not a member of target group message. If i change the script to use any of the other groups that show in my token cache it works fine.....

So how do i get it to recognise i am a member of this new group.??

Top
#200160 - 2010-10-05 01:45 PM Re: Mapping a drive for a group [Re: nige1979]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Groups are assigned at logon so if you add yourself to the group and manually start the script it will not work. If you are a member of the group and it also does not work at logon then replication between your DC's might have an issue. If you delete the registry key, logoff and logon so that the script runs do you get the drives then and is the registry key filled with the correct data?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.076 seconds in which 0.024 seconds were spent on a total of 15 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org