Page 1 of 1 1
Topic Options
#75564 - 2003-06-27 07:36 PM Beginner: Drive mapping question
Laura Offline
Fresh Scripter

Registered: 2002-01-25
Posts: 7
Loc: MD
Hi! I've got a working Kixtart login script (Kixtart is great!) however I'm trying to modify a group and it will not map that group to a drive.

The original line is:

select
case ingroup("Administration List")
use g: "\\fileserv\shared\administration"
endselect

I want to change it to:

select
case ingroup("AIST")
use g: "\\fileserv\shared\administration"
endselect

I simply replace Administration List with AIST and the drive won't map. I've tried to create another script with no variables and I don't get the mapping. However when I change AIST back to Administration List it works again. I've checked rights and permissions on the server and those are all working correctly.

Any ideas?

Thank you
Laura

Top
#75565 - 2003-06-27 07:39 PM Re: Beginner: Drive mapping question
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Laura,

Why not just do this?

code:
if ingroup("AIST") 
use g: "\\fileserv\shared\administration"
endif

If this does not work, try preceding "AIST" with "DOMAIN\AIST".

The SELECT..CASE.ENDSELECT is used in the event where you would have many IF..ENDIF statements. The caveat to SELECT..CASE..ENDSELECT is where it will find the first true condition and leave.

Are these NT, 2K, or better workstations?

HTH,

Kent

[ 27. June 2003, 19:41: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#75566 - 2003-06-27 07:46 PM Re: Beginner: Drive mapping question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Also, deep mapping is only supported under Windows 2000/XP/2003.

You might also have to flush the token cache if you make group changes on the fly.
_________________________
There are two types of vessels, submarines and targets.

Top
#75567 - 2003-06-27 07:46 PM Re: Beginner: Drive mapping question
Laura Offline
Fresh Scripter

Registered: 2002-01-25
Posts: 7
Loc: MD
Thanks, Kent!

Actually we do have many departments in that section of the login script which is why we are using select/case/endselect functions. I've tried isolating the line into a new script and testing with both if/endif and select/endselect but its no go.

I did just test with the domain\AIST and it won't run.

I thought it might be that we have two similarly named groups but changing the name produced no positive result.

Thanks!
Laura

Top
#75568 - 2003-06-27 07:49 PM Re: Beginner: Drive mapping question
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If working with new groups, the group cache can bite. Try flushing with /F. It's in the manual.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#75569 - 2003-06-27 07:50 PM Re: Beginner: Drive mapping question
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Laura,

Back to my question - Are these NT/2K/XP?

What about Jens' - Deep Mapping?

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#75570 - 2003-06-27 07:55 PM Re: Beginner: Drive mapping question
Laura Offline
Fresh Scripter

Registered: 2002-01-25
Posts: 7
Loc: MD
Windows 2000 servers, and I'm testing on a Windows 2K workstation. We are using a mix of 2000 and XP desktops generally.

I'm looking in the manual for how to flush cache...not finding anything yet but I'll keep looking. Thanks!

Laura

Top
#75571 - 2003-06-27 07:56 PM Re: Beginner: Drive mapping question
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Laura,

Page 19 of 4.21 manual.

KIX32 yourscript.kix /f

quote:

C:\>kix32 /?

KiXtart 2001 4.21 (Copyright Ruud van Velsen 2003)
Microsoft Windows (logon) script processor.

Note: KiXtart 2001 is CareWare, please consult the manual for full
details on distribution and licensing.

Usage :

KIX32 [script1] [...] [$var=123] [/f[:yyyy/mm/dd]] [/r:irel] [/d]

Options:
/f = flush token cache (optionally only if older than date specified)
/r = KXRPC search order (see manual for details)
/d = enable debug mode

Kent

[ 27. June 2003, 19:58: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#75572 - 2003-06-27 09:02 PM Re: Beginner: Drive mapping question
Laura Offline
Fresh Scripter

Registered: 2002-01-25
Posts: 7
Loc: MD
Thanks!!

Flushing worked beautifully and it tested well. Now I can start on the other groups.

[Smile]

Laura

Top
#75573 - 2003-06-27 09:34 PM Re: Beginner: Drive mapping question
Gaven Offline
Starting to like KiXtart
*

Registered: 2003-06-19
Posts: 103
Loc: Washinton DC, USA
You may want to consider changing to a series of If-EndIf's instead of CaseSelect's. What if a person is in more then one group? Or even better, how about posting your whole script to this post? I bet you the forum has it fully optimized in 12 hours.

[ 27. June 2003, 21:38: Message edited by: Gaven ]

Top
#75574 - 2003-06-27 09:36 PM Re: Beginner: Drive mapping question
Laura Offline
Fresh Scripter

Registered: 2002-01-25
Posts: 7
Loc: MD
Thanks, Gaven. I'm working through the script cleaning it up; most of our staff are only in one group, or department. Any "special" interdepartment groups are handled in a different section with if/endif.

Laura

Top
#75575 - 2003-06-28 12:42 AM Re: Beginner: Drive mapping question
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
weird...
laura nicknamed person comes here and he/she ( [Wink] ) seems like a real admin. and even seems to understand the language structure even...
uuh, this is one of the moments I feel astonished.
_________________________
!

download KiXnet

Top
#75576 - 2003-06-28 03:49 PM Re: Beginner: Drive mapping question
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Gaven,

Did I hear an echo in here? I did not say it as eloquently as you. But, I did say with the SELECT..CASE..ENDSELECT it leaves this construct on the first true condition. That is with the INGROUP.. it leaves on the first true one. From her response, she understands this as well.

So.. Yes, you are right the IF..ENDIF structure is great when your users are members of more than one group.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#75577 - 2003-06-28 03:54 PM Re: Beginner: Drive mapping question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Just another hint. The lastest release of KiXtart allows to provide an array of groupnames into INGROUP() with an optional parameter to test for membersip in either ANY or ALL groups.
_________________________
There are two types of vessels, submarines and targets.

Top
#75578 - 2003-06-30 10:55 PM Re: Beginner: Drive mapping question
Laura Offline
Fresh Scripter

Registered: 2002-01-25
Posts: 7
Loc: MD
*laugh* Yes, a gen-u-wine network admin!

So far the login script is working great and I'm testing it with if/endif statements [Smile] which make things simpler.

On each test machine though I'm having to map to the kixtart script folder on the server and flush the kixtart cache. I've tried as different people, on different OS's, and even rejoining the computer to the domain.

Since y'all have saved my life before, any thoughts?

Laura (who checked the manual [Smile]

Top
#75579 - 2003-06-30 11:12 PM Re: Beginner: Drive mapping question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You would want to put your script and the KiXtart executables into the NETLOGON share, as described in the KiXtart Manual and the 'KiXtart Starters Guide' in the FAQ Forum.

The token cache flushing is normally not necessary when logging in. However, chnages to groups need to replicate across the DCs.

Finally, you can rearrange your drive mappings in more convenient ways, see for example this .INI file structure
code:
; Mandatory drive shares for users v1.0
;
; Format:
;
;[Drive letter]
;UNC = UNC name of the drive share
;GroupInclude = User groups to be included in the drive share
;CompExclude = Computers to be excluded from the drive share
;UserInclude = Users to be included in the drive share
;NetworkType = Type of network connection allowed for this share (LOCAL, LAN, VPN, DIALUP)
;DenyGuestAccess = True if guests are not allowed to access this share

or alternatively this format
code:
; Mandatory drive shares for users v2.0
;
; Format:
;
;[UNC]
;Drive = drive letter to which the UNC name will be mapped
;GroupInclude = User groups to be included in the drive share
;CompExclude = Computers to be excluded from the drive share
;UserInclude = Users to be included in the drive share
;NetworkType = Type of network connection allowed for this share (LOCAL, LAN, VPN, DIALUP)
;Persistent = True if mapping is persistent
;DenyGuestAccess = True if guests are not allowed to access this share

This allows you to manage the drive shares without changing KiXtart code.

The KiXtart script section for drive mappings looks like this
code:
;-------------------------------------
; subroutine to map drives based on user groups
;
; Structure of the .INI file:
; [Drive letter]
; UNC = UNC name of the drive share
; GroupInclude = User groups to be included in the drive share
; CompExclude = Computers to be excluded from the drive share
; UserInclude = Users to be included in the drive share
; NetworkType = Type of network connection allowed for this share (LOCAL, LAN, VPN, DIALUP)
; Persistent = True if mapping is persistent
; DenyGuestAccess = True if guests are not allowed to access this share
;-------------------------------------
:NETWORKED_DRIVES
Dim $driveletters, $drive, $unc, $persistent, $rc, $server
Dim $GroupInclude, $CompExclude, $UserInclude, $denyguestaccess
Dim $networktype

if not exist($SHARESINI)
$rc=warning('NETWORKED_DRIVES: Cannot open network shares initialization file '+$SHARESINI)
return
endif

$rc=displaytext('Connecting network shares')
$driveletters=readprofilestring($SHARESINI,'','')
$driveletters=atrim(split($driveletters,chr(10)))
for each $drive in $driveletters
if $drive<>''
$unc=trim(readprofilestring($SHARESINI,$drive,'UNC'))
if $unc<>''
$denyguestaccess=val(readprofilestring($SHARESINI,$drive,'DenyGuestAccess'))
if $GUESTACCESS=1 and $denyguestaccess=1
$rc=displaytext('Guest access is not allowed to UNC '+$unc,1)
use $drive+':' /delete /persistent
else
$networktype=readprofilestring($SHARESINI,$drive,'NetworkType')
$networktype=atrim(split($networktype,','))
if isinarray($networktype,$NETWORKCONNECTION)
$rc=displaytext('Network connection type '+$NETWORKCONNECTION+' authorized to map drive letter '+$drive,1)
$GroupInclude=readprofilestring($SHARESINI,$drive,'GroupInclude')
$GroupInclude=atrim(split($GroupInclude,','))
$CompExclude=readprofilestring($SHARESINI,$drive,'CompExclude')
$CompExclude=atrim(split($CompExclude,','))
$UserInclude=readprofilestring($SHARESINI,$drive,'UserInclude')
$UserInclude=atrim(split($UserInclude,','))
$persistent=val(trim(readprofilestring($SHARESINI,$drive,'Persistent')))
if isincluded($GroupInclude, $CompExclude, $UserInclude)
$rc=mapdrive($drive,$unc,$persistent)
endif
else
$rc=displaytext('Network connection type '+$NETWORKCONNECTION+' not authorized to map drive letter '+$drive+' to '+$unc)
endif
endif
endif
endif
next
return



[ 30. June 2003, 23:15: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#75580 - 2003-07-01 03:22 PM Re: Beginner: Drive mapping question
Gaven Offline
Starting to like KiXtart
*

Registered: 2003-06-19
Posts: 103
Loc: Washinton DC, USA
Laura, chances are this is a complete miss but, could the fact that Z:\ (temporary mapping for logon scripts) disappears once the calling batch file is done play a hand in your problems? If you use kix instead of lmscript this happens once the token file is placed.
Top
#75581 - 2003-07-01 03:34 PM Re: Beginner: Drive mapping question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The Z: drive is only mapped temporarily under Windows 9x, not Windows NT/2000/XP/2003.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 476 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.076 seconds in which 0.03 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