Page 1 of 1 1
Topic Options
#5525 - 2000-12-04 09:44 PM user directories
Anonymous
Unregistered


Hello, and let me apologise in advance This is probably a question that comes up often. I am migrating from a Novell enviroment to a NT enviroment and I am looking for a way to map user directories as the root of u:. Instead of one level up. I have tried many veriations of use u: \\servername\sharename\@userid and none seem to work. I know I could possibly share the directories as %userid%$ but that would be more of a hassle considering the number of users. Letting NT create the directories seems to be the easiest. So if anyone has any ideas or scripts I would greatly appreciate it.
Thanks,

------------------

Top
#5526 - 2000-12-04 10:01 PM Re: user directories
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Sorry Dude,

That's not possible with NT4.0.

If you would upgrade to Windows2000 it would be possible.

So I guess your stuck with the userspecific share.

Greetz,

Roger the Young

_________________________
The Code is out there

Top
#5527 - 2000-12-04 11:43 PM Re: user directories
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
(At ease DrillSergeant)

If you are using only NT-workstations you can use the subst-command for deep-rooting.

For Win9x you can make a script to create the @UsrId shares on the server, i have seen scripts doing this on this board.

Erik

Top
#5528 - 2000-12-05 10:03 AM Re: user directories
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
I humbly stand corrected.
_________________________
The Code is out there

Top
#5529 - 2000-12-05 05:38 PM Re: user directories
Anonymous
Unregistered


Do you have any example script?

[This message has been edited by Camon (edited 05 December 2000).]

Top
#5530 - 2000-12-05 06:53 PM Re: user directories
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
An example using SUBST command in NT:
code:

If @InWin = 1
Shell '%COMSPEC% /C Subst u: "\\servername\sharename\@userid"'
EndIf

If you have win9x workstations, you have to use another aproach, you must create a
share for each user, so you can use:
Use U: "\\servername\@userid"

The shares can be created from a kix script using RmtShare.exe from the NT-server ressource kit.
Maybe other board menbers can remember where to find an example script.

Erik

Top
#5531 - 2000-12-05 09:39 PM Re: user directories
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Here is a script to make a hidden share for each user found in the "Users" directory.

To make the script work:

  • You have to have RmtShare.exe from the NT Server Ressource Kit in your path.
  • The directory containing user directories may not contain any other directories
  • Directory names must be spelled exactly the same way as the user name
  • You must be logged in as administrator

After running this script on the server, you can map the drives for each user as:
USE U: "\\Server\@UserID$"

(The script can be run on the server, another server in the domain or a NT workstation in the domain)

code:
Break On
$Server = "\\Server" ; Change to point to your server
$MasterShare = "\\Server\Share" ; Change to point to your user directory share
$MasterPath = "D:\Users" ; Change to point to the location of user directory share on the server

; Open Error log
Del "%TEMP%\Error.log"
$Err = Open(9, "%TEMP%\Error.log", 5)
; Create list of subdirs
Shell '%COMSPEC% /C Dir $MasterShare /AD /B > %TEMP%\DirList.lst'
$Err = Open(1, "%TEMP%\DirList.lst")
$UsrDir = ReadLine(1)
While @Error = 0
$NewShare = "$Server\$UsrDir" + "$"
$Cmd = '%COMSPEC% /C RmtShare $NewShare > %TEMP%\Share.lst'
Shell '$Cmd'
$Err = Open(2, "%TEMP%\Share.lst")
$Ressource = ReadLine(2)
If InStr("$Ressource","Share name")
$Ressource = ReadLine(2)
If InStr("$Ressource","$MasterPath\$UsrDir") = 0 ; share exists pointing to another location
$Line = "Error: Share " + $UsrDir + " connected to " + $Ressource
$Err = WriteLine(9, "$Line")
;Else
; Share already exists and is ok
EndIf
Else
$Cmd = '%COMSPEC% /C RmtShare $NewShare=$MasterPath\$UsrDir /grant $UsrDir:full /grant Administrator:full > Nul'
Shell '$Cmd'
EndIf
$Err = Close(2)
$UsrDir = ReadLine(1)
Loop

$Err = Close(1)
$Err = Close(9)

Return


Check the file: "%TEMP%\Error.log" for errors after running the script, if the file is empty, no
errors was found.

I had to write this script to prove it can be done. I have seen something similar somewhere on the net, but this
should do the tiresome job of creating a share for each user.

Erik


ps.
You might not want to use the same parameters for RmtShare.exe as i have used. To see the syntaks of RmtShare.exe
just type RmtShare without parameterts.

DrillSergeant, I just couldn't ressist the assosiation to your name

[This message has been edited by kholm (edited 06 December 2000).]

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 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.056 seconds in which 0.027 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