[K12OSN] samba drives/home folder and MS Vista probs

Jim Kronebusch jim at winonacotter.org
Wed Aug 15 14:13:33 UTC 2007


> I've never gotten into setting up any logon.bat files for windows logins.
> Would I simply enter what you've suggested in the logon.bat file on the
> Samba server? If so, how can i do that for all domain users? I have looked
> a bit at this many moons ago. but I just done a setup from a howto,that
> someone had posted and Samba " just worked",to were all users that logged
> onto our domain had a home folder/h: drive on the Samba server. now with
> Vista,this is not happening:(.
> Can you give me a
> 1. do this
> 2. do this
> 3. do this ,,,
> Refire Samba server and give 'er a go!

I am guessing that since you can map the shares when Vista is running that a logon.bat
will certainly work.  I have mostly only created logon.bat files in an all Windows
network in the past.  Using logon.bat files is more stable than just mapping and hoping
they reappear, say a user inadvertently removes the map, it will still be recreated at
logon.

I have only messed with logon batch files from a linux samba server once and that was a
few years ago.  It looks like Huck is a little more familiar with this, keep prodding
him for info and I'm sure you'll get something working.

What exactly do you want your mapped drives to do?  Do you want to map
//servername/Users or do you want to map each user personally such as
//servername/Users/username?

Let me know and I should be able to provide exactly what you want your batch file to
look like.  There are a ton of ways to create the batch files and a ton of options. 
Usually a typical map for a users home first deletes the existing map, then creates the
new map with a variable to plug in username.  It might be a good idea to first map to
the general Users folder, then if that works try a variable.  It might be that some of
the old variables are broken in Vista, I haven't had to work with this on Vista yet.

Below is what a batch to map the Users folder could look like.  The REM is the same as a
# in linux and the text following is just a note of what the next line will do:

REM Delete pre-existing drive mappings
NET USE H: /DELET >nul

REM MAP H: To Users
NET USE H: \\servername\Users

Place the above text is a plain text file called logon.bat and put it in the correct
place on the server.  Hopefully Huck can provide the specifics on how to do that.

Here is some more info on using variables from the windows environment.  At the command
line on your Windows machine type "set" without the quotes.  This should provide a list
of environment variables that can be used.  An example output is listed below:

ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\user\Application Data
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=UserDesktop
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=H:
HOMEPATH=\
HOMESHARE=\\servername\user
LOGONSERVER=\\servername
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program 
Files\SSH Communications Security\SSH Secure Shell
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 6, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=0806
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\user\LOCALS~1\Temp
TMP=C:\DOCUME~1\user\LOCALS~1\Temp
USERDOMAIN=DOMAIN
USERNAME=user
USERPROFILE=C:\Documents and Settings\user
windir=C:\WINDOWS

The above would have been run on a machine with the name "UserDesktop", and logged in
with the user "User" to the domain "DOMAIN" from server "servername".  Now you can plug
any of those variables into your batch file like so:

NET TIME %LOGONSERVER% /set /yes

REM Delete pre-existing drive mappings
NET USE H: /DELET >nul

REM MAP H: To Users Home Directory
NET USE H: %LOGONSERVER%\Users\%USERNAME%

REM MAP Z: Some other share
NET USE Z: %LOGONSERVER%\OtherShare

The use of the variables will help you set up more specific batch files.

Jim

-- 
This message has been scanned for viruses and
dangerous content by the Cotter Technology 
Department, and is believed to be clean.




More information about the K12OSN mailing list