#11649 - 2001-08-19 01:56 AM
PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Anonymous
Anonymous
Unregistered
|
I apologize to everyone for asking this because it's been done to death, but could someone PLEASE explain how to map to a user's home directory with a Windows 98 client? I just don't get it. And please don't say "search the message board" because I've done that and tried all the suggestions, but none have worked for me.Here's what I've got: A W2K server called SERVER. A W98 client. Let's say the client's username is BSmith. I want BSmith's home drive to be mapped to C:\users\bsmith on the server. The folder "users" is shared as "users" but "bsmith" is not shared. Ok, in Active Directory Users and Computers, I go to the PROFILE tab of BSmith and set his home folder to connect to \\server\users\%username%. This creates the "bsmith" folder in "users" folder. In my Kixtart script, I've tried: USE H: @HOMESHR --doesn't work USE H: "@HOMESHR" --doesnt' work I've read on here that W9x clients can't map to folders below a share, and that you need to make them a hidden share, so this is what I did: * I shared the BSMITH folder as BSMITH$ * I changed the home folder profile path on the server to map to \\server\bsmith$ I then ran my script. Still does NOT work. I also tried using USE H: "\\server\@userid$" but this does not work either. Can someone PLEASE PLEASE tell me what I need to do: 1. On the server to get this mapping to work. 2. On the client to get this mapping to work. 3. Put in my script to get this mapping to work. Also, I would really prefer NOT having to use the "hidden share" thing if at all possible. This would mean I can't use the %username% variable setting up user accounts and that I would have to manually go to the USERS folder and manually create hidden share names for ever user(!). Thanks in advance.
|
Top
|
|
|
|
#11651 - 2001-08-20 12:21 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Anonymous
Anonymous
Unregistered
|
Thanks, but that didn't work. Like I said, I have a Windows 98 client, not NT.
|
Top
|
|
|
|
#11652 - 2001-08-20 10:28 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
I don't think it as OS spesific. It would help search the problem, if you could get the error codes out from it.make a script like: cls "homeshare:@HOMESHR" ? USE H: @HOMESHR "@serror : @error" ? USE H: "@HOMESHR" --doesnt' work "@serror : @error" ? USE H: "\\server\@userid$" "@serror : @error" ? gets $ and post the output on board for us to see which is really going wrong. cheers,
_________________________
!download KiXnet
|
Top
|
|
|
|
#11653 - 2001-08-21 03:20 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Anonymous
Anonymous
Unregistered
|
Thanks for the input. I did the script like you said. All I got were two lines that repeated 4 times:The local drive name is already in use 85 Note, that the client does NOT already have a drive mapped to his home directory and that this script still did not map the drive.
|
Top
|
|
|
|
#11654 - 2001-08-21 10:34 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Anonymous
Anonymous
Unregistered
|
Omegawulf, I am trying to understand your problem, please correct me if any of these statements are wrong;1. You have a share mapped at the dir higher than (super directory ?) the home directories 2. You dont want to map each of these home directories as shares 3. You want to create a net use connection at logon. If I am reading this right, one of the problems is that on 98 you cannot use a UNC that continues after the share name (you can in some NT and 2k) That is, if you have a share <SHARE> on a server <server>, you can do USE H: \\<server>\<share> but you cannot do USE H: \\<server>\<share>\<subdir> So how about trying the following script. code:
USE Z: /DELETE USE H: /DELETE USE Z: \\server\users ? "<@ERROR><@SERROR>" SHELL "SUBST H: Z:\@USERID" ? "<@ERROR><@SERROR>"
This will point H: to the dir of the users share with the name of the userid (no $ - but add that if thats what you are doing) hth Mark [ 21 August 2001: Message edited by: Mark Antrobus ]
|
Top
|
|
|
|
#11655 - 2001-08-21 10:56 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Hello Omegawulf,Is it possible that the user in question has a Jaz or Zip drive or other type of drive that is already taking H: ? Try the code again, but this time use P: instead. USE P: /DELETE USE P: @HOMESHR Also try doing the same from a DOS prompt on the machine. NET USE P: /DELETE NET USE P: \\SERVER\BSMITH$ If this does not work from a DOS prompt it is not going to work from KiXtart either. If it does not work from the command prompt, then what Microsoft Error does it give back? Are you sure the BSMITH account has Rights on the BSMITH$ share? Does the user have NTFS rights on this folder?
|
Top
|
|
|
|
#11656 - 2001-08-22 02:48 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Anonymous
Anonymous
Unregistered
|
Thanks for you replies, guys. First, Mark Antrobus, your statement #'s 1, 2, and 3 are all correct in that this is what I want to do. However, as you indicated, you--normally--cannot map to a folder below a share. But I have tried sharing the user's home directory, but mapping to this share does not work. I tried your script suggestion, but that did not work either. The error I get is: 85 the local device name is already in use. Cannot SUBST a network drive. 1 Inncorrect function. (I don't understand what the SHELL command is supposed to accomplish in the script you suggested). Second, NTDOC, yes, BSMITH has share and NTFS rights to his share. However, adding the line, USE P: /DELETE before USE P: @HOMESHR, as you suggested, did work. The user was successfully able to map to his share. But here is the problem. I do NOT want to map it this way because then I have to share the user's home directory. I understand that you cannot normally connect to a folder below a share on W9x systems, but isn't there a work around? Consider this; let's say I have 1,000 users already on the network. Now, to run this script to automap home directories, I'll need to go back and share all 1,000 of those user home drives! Also, for any new users created, I'll have to remember to go back and share their home directories once their user profile is created. It's so much easier to add new users with a template using the %username% command in their profile to auto create their home directory. Having to go back and manually share each and every home directory seems like a chore that scripting is supposed to get rid of, right? Or am I missing something here? -Thanks in advance for your help!
|
Top
|
|
|
|
#11657 - 2001-08-22 03:34 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Hello Omegawulf,This command will do the task for you automatically... code:
for /f "Tokens=*" %%i in ('dir /B D:\users') do NET SHARE %%i$=D:\users\%%i /Y
As long as you place all of your USER directories under D:\USERS you can modify to a different drive\folder but they need to all be under the same default folder.Please see the following posts to get more information and methods to SHARE Creating Shares and Setting Permissions Mapping directly to a non shared directory There is also a program called AUTOSHAREIT that will run as a service on your computer and any folder that is created under the "watched" folder/s will automatically be shared using a $ hidden format. Not a freeware product though. [ 22 August 2001: Message edited by: NTDOC ]
|
Top
|
|
|
|
#11658 - 2001-08-22 11:39 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Anonymous
Anonymous
Unregistered
|
What is the value of @Ldrive?I remember something like this where there was a lastdrive set in config.sys and LDrive was mapped to H:
|
Top
|
|
|
|
#11660 - 2001-08-22 03:37 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Anonymous
Anonymous
Unregistered
|
Hello,I have the follow Code to do the drive maps in my logon script. It's working very well in my network. Some pieces of the code are in portuguese, 'cause i'm in Brazil. Code -------------------------------------- Unmapping Home Área ? "U:" Use u: /delete /persistent If @ERROR = 0 " - OK" Else " - Erro: @error" EndIf ? "Mapeando HOME AREA do usuário: " + @USERID " na estação: " + @WKSTA If (( @WKSTA = "Sultsbase1" ) Or ( @WKSTA = "Sultsbase2") Or ( @WKSTA = "Sultsbase3")) ? "Connecting to Terminal Server." ? "Your Home Area will be mapped by another process." Else Use u: "\\sulfs00\@USERID$$" If @ERROR = 0 " - OK" Else " - Erro: @error" Endif EndIf --------------------------------- I hope this help someone. [ ]'s Evandro code:
|
Top
|
|
|
|
#11661 - 2001-08-22 11:14 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
bleonard
Seasoned Scripter
Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
|
Omegawulf - The proper command-prompt syntax to map a drive to a home share without creating a shared resource for each directory is:Win2K: NET USE <DRIVE>: \\Server\Share\Sub Folder WinNT: SUBST <DRIVE>: \\Server\Share\Sub Folder Win9x: NET USE <DRIVE>: /HOME To delete these mappings: Win2K: NET USE <DRIVE>: /DEL WinNT: SUBST <DRIVE>: /D Win9x: NET USE <DRIVE>: /DEL To execute these within a KiX script, use the SHELL command: SHELL "comspec /c NET USE H: /HOME" A simple script to handle all this could be: SELECT CASE (@INWIN = 1) AND (@DOS >= 5) SHELL "comspec /c NET USE H: \\Server\Users\@USERID" CASE (@INWIN = 1) AND (@DOS >= 4) SHELL "comspec /c SUBST H: \\Server\Users\@USERID" CASE (1) SHELL "comspec /c NET USE H: /HOME" ENDSELECT Let me know how this works. Bill [ 22 August 2001: Message edited by: bleonard ]
|
Top
|
|
|
|
#11662 - 2001-08-23 03:07 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Anonymous
Anonymous
Unregistered
|
First off I'd like to thank everyone for your continued help. Most people in bulletin boards I post to never reply to my questions. It's nice to see such a helpful Kixtart community.Anyway...on with the show! BLEONARD, I tried your script to map the home drive and it did not work. I added ? "<@ERROR><@SERROR>" to the end of it to see why it wasn't working and the error I got was "2 The system cannot find the file specified." VENOM, would love to try yours, but since it's in Portuguese, I don't know how to translate. CHRIS PAGE, I have no lastdrive specified (so, basically, it's Z). NTDOC, I tried that line but that didn't map the home drive either. In fact, I'm not sure if it even ran correctly because it terminated awfully fast (it didn't give me an error nor did it even run my sleep 6 command I put after it). What drive does that line attempt to map to, F? I can't tell (yeah, I'm a newbie ) EVERYONE--does it matter where Kixtart is running from? I have it running from the server and not the client. Could this be the problem?
|
Top
|
|
|
|
#11664 - 2001-08-23 09:16 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
Anonymous
Anonymous
Unregistered
|
|
Top
|
|
|
|
#11665 - 2001-08-23 10:34 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
If Omegawulf is willing or wanting to purchase ScriptLogic I suppose it may help.Otherwise, the current postings and links to other postings allow you to perform this task without spending a dime on other software. This information may/may not be more confusing to someone unfamiliar with the normal procedures. But I'm sure Omegawulf appreciates everyones ideas... Omegawulf,
Open notepad and copy/paste the following entry into notepad. for /f "Tokens=*" %%i in ('dir /B D:\users') do NET SHARE %%i$=D:\users\%%i /Y
Then save this file as SHARE-D.BAT
Then copy the batch file to the Server where you have the USERS folder and your user folders under USERS. If this drive is not D: then edit it to match your drive. Then from a DOS Prompt execute this batch file. It should go through all the users folders and share them out as a hidden share. Then paste this code into a new file and name it CHANGEHOMEDIR.BAT It must be run from the PDC or a BDC for /f "Tokens=*" %%i in ('dir /B \\sm-cag-fp03\vol1\users') do NET USER %%i /homedir:\\sm-cag-fp03\%%i$ Edit the file to match the names and shares of your server. Example \\myserver\sys\users Then execute this batch file from a command prompt on the PDC or a BDC and it will change the logon home directory for all the accounts that it can match from User Manager. Let me know if you need further explanation before trying this as it will change ALL the accounts that match under the USERS folder.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 447 anonymous users online.
|
|
|