Page 1 of 1 1
Topic Options
#1517 - 2000-01-26 04:11 PM mapping user specific share using kixtart login script.
Anonymous
Unregistered


Hello everybody,
I've just started using kixtart (in the test phase to be precise). So far I can't seem to map the users specific share e.g if the users login name is EHarris then his U:\ drive should have the following share mapping:- \\pdc\EHarris

What am I doing wrong?

Here is a copy of my login script. Login.bat is called when the user logs on.

:Login.bat
@echo off
%0\..\Kix32.exe script1.scr
exit

:Script1.scr
? "Setting DOS variables..."
SHELL "winset.exe USERNAME=@USERID"
SHELL "Winset.exe ADDRESS=@ADDRESS"
SHELL "Winset.exe COMPUTER=@WKSTA"
SHELL "Winset.exe DOMAIN=@DOMAIN"
SHELL "Winset.exe COMMENT=@COMMENT"
SHELL "Winset.exe FULLNAME=@FULLNAME"
SHELL "Winset.exe HOMEDIR=@HOMEDIR"
SHELL "Winset.exe HOMESHR=@HOMESHR"
SHELL "Winset.exe LSERVER=@LSERVER"
SHELL "Winset.exe PRIV=@PRIV"
? "Done."
Call groups.scr
EXIT

:Groups.scr
use u:"\\gbcoty194c010\"+@userid
use f:"\\gbcoty194c010\common"

If INGROUP("marketing")
use g:"\\gbcoty194c010\marketing"
endif
exit


Top
#1518 - 2000-01-26 05:49 PM Re: mapping user specific share using kixtart login script.
Anonymous
Unregistered


It's good practice to do a /DELETE before you do a drive mapping as the user may have a persistent drive mapping set for the drive you are trying to use.

Aren't you using the user manager settings to set the home drive for your users? It's much simpler.

Top
#1519 - 2000-01-26 08:19 PM Re: mapping user specific share using kixtart login script.
Anonymous
Unregistered


The other thing is you need to place " around the drive letter as well as the UNC path.

eg.

USE "D:" "\\MyServer\AShare"

Top
#1520 - 2000-01-27 07:27 AM Re: mapping user specific share using kixtart login script.
Anonymous
Unregistered


I'm not sure what the exact syntax is for /delete. In any case I made sure there is nothing mapped to the u:\ drive before I logged in with the kixtart login script. I have tried putting the letter in inverted comma e.g.
use "u:" "\\gbcoty194c010\"+@userid

that did not work either

Top
#1521 - 2000-01-27 08:06 AM Re: mapping user specific share using kixtart login script.
Anonymous
Unregistered


Hi afzalhussain

What clients? Win9x or NT?

If Win9x then ensure KXRPC is running on all PDC/BDC's that may authenticate logins. Some discussion on this board whether RPC is needed or not? Your choice.

Here is my login.bat as used at one of our clients. (not saying you have to do it this way! just test it on your systems) It's fairly basic but it's the best way to start.

;login.bat
;this copies the reqd files over to the client (you could run kix32 direct from netlogon if you like) then runs kix32 script at the end

CLS

ECHO Verifying/Upating Script & Software Installs, Please Wait...

IF "%OS%" == "Windows_NT" GOTO WinNT
REM * If can't detect WinNT, assume system is Win95/98
rem XCOPY %0\..\KXRPC.EXE %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL
XCOPY %0\..\KIX32.EXE %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL
XCOPY %0\..\KX16.DLL %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL
XCOPY %0\..\KX32.DLL %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL
XCOPY %0\..\KX95.DLL %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL
ECHO Finished Verifying/Upating Script Installation.
GOTO Runscript

:WinNT
XCOPY %0\..\KIX32.EXE %WINDIR%\SYSTEM32\ /D /H /I /R /V > NUL

ECHO Finished Verifying/Upating Script Installation.
GOTO Runscript

:RunScript
CLS
ECHO Mapping NT Directories Please Wait...

%WINDIR%\SYSTEM\kix32.exe %0\..\maps.kix

EXIT

-----------

maps.kix

IF INGROUP ("yourusers")
USE U: "\\server\users"
USE R: "\\server\share"
$drive="\\server\"+@userid+chr(36)
USE X: $drive
endif

----------

The users home dir's are hidden shares, the $drive="\\server\"+@userid+chr(36) maps as X: \\server\fred$ on Win9x systems. Or you could try use x: "\\server\@userid$$".

Notice winset is not used.

Hope this helps.

Rgds
Don


Top
#1522 - 2000-01-27 09:51 AM Re: mapping user specific share using kixtart login script.
Anonymous
Unregistered


Hello,

As Don said, if you have Win9x clients, you need to run RPC for some of those macros. Do you need to set all of those environment variables? Kix doesn't need them set, neither NT nor Win9x need them set - only set them if you are going to use them in some other program. To simplify your testing, I would take them out for now.

You do not need quotes around the drive letter. Do make sure there is a space between the drive letter/colon and the UNC (I couldn't tell if there was or not). Immediately after doing a use, check the error code and see what is happening.

Hope this helps some.

------------------
Regards,

Brad
Consultant
Net InfraStructure, Inc

Top
#1523 - 2000-01-28 12:45 AM Re: mapping user specific share using kixtart login script.
Anonymous
Unregistered


Thanks a lot Don. That worked fine. However I would like to make absolute certain that when the user logs out all his/her shares are disconnected. I now you can use the "use <drive letter>: /delete" for every single drive letter that I want to map. I just wondered if there are any easier ways of doing this.

To give you an idea along the lines i'm thinking of would be. the command line used in NT. i.e.
net use g: \\pdc\sharename /persistent:No

Many thanks for your help

Top
#1524 - 2000-01-27 01:49 PM Re: mapping user specific share using kixtart login script.
Anonymous
Unregistered


Hi

Glad to hear your sorted (as they say in Manchester, UK!)

I am not too sure about removing/deleting drive mappings on logging out! But I think most admins remove them as users log in before re-mapping afresh using Kixtart. (Hope I make sense here?)

Now, I have not yet come across a reson to remove persistant mappings yet! But I am sure someone here will help you on that one?

TIA
Rgds

------------------
Don Davidson
Network Engineer
http://www.insight-media.co.uk



Top
#1525 - 2000-01-27 02:58 PM Re: mapping user specific share using kixtart login script.
Anonymous
Unregistered


Hello,

Drives mapped with: "use d: ..." are not persistent unless you add the /persistent. You may verify this by running the following subroutine to enumerate persistent connections after you map your network drives.

code:

;****************************************************************************************
:ENUMPERSIST
; Description:
; Enumerate all the user's persistent connections. Want to keep it in a log
; in case the user has a problem.
;
; Input:
; $OS, $HKCU, $user
;
; Output:
; None
;****************************************************************************************
; Modification History
; Date Initials Description
; 11 Aug 99 bvv Wrote first cut.
;****************************************************************************************
;
Dim $index, $persist, $loop_index, $name, $keyname, $p_name, $returncode
$index=0
If $OS="Win9x"
$persist="$HKCU\Network\Persistent"
Else
$persist="$HKCU\Network"
Endif
? "Enumerate the persistent connections: "+$persist
$loop_index=0
While $loop_index=0
$name=EnumKey("$persist",$index)
$loop_index=@ERROR
If $loop_index=0
$keyname=$persist+"\"+$name
$p_name=ReadValue("$keyname","RemotePath")
? "The enumerated value is: "+$name+" and its UNC is: "+$p_name+"."
; If you want to delete the keys, uncomment the next few lines.
; $returncode=DelKey($keyname)
; If $returncode=0
; ? "The persistent connection to "+$p_name+" was deleted."
; ? "The index value is: "+$loop_index+"."
; Else
; ? "There was a problem deleting the persistent connection to: "+$p_name
; Endif
$index=$index+1
Else
If $loop_index=259
; This error should come up when all entries have been enumerated.
? "All persistent connections have been listed."
Else
; An unknown error has occurred.
? "An error has occurred while enumerating persistent connections. The"
? "error number is: "+$loop_index+"."
Endif
Endif
Loop
Return

$OS is set to either "Win9x" or "Windows NT" elsewhere.
$HKCU is set to "HKEY_CURRENT_USER"
and $user is set to @USERID

------------------
Regards,

Brad
Consultant
Net InfraStructure, Inc

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 1619 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.188 seconds in which 0.126 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