Page 1 of 3 123>
Topic Options
#11649 - 2001-08-19 01:56 AM PLEASE HELP WITH MAPPING HOME DIRECTORY
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
#11650 - 2001-08-19 09:21 AM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
pvds Offline
Hey THIS is FUN
*****

Registered: 2001-04-14
Posts: 201
This works on my NT WS

use x: ("\\server\@userid$")

GR Peter

Top
#11651 - 2001-08-20 12:21 AM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
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 Administrator Offline
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
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
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 Offline
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
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 Offline
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
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
#11659 - 2001-08-23 12:24 AM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
@-represents kix-macro's. they are listed in kix-manual.
@ldrive is shorthand to "%logonserver%\netlogon\"
_________________________
!

download KiXnet

Top
#11660 - 2001-08-22 03:37 PM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
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 Offline
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
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
#11663 - 2001-08-23 04:23 AM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Omegawulf,

It is fine to run KiXtart from the server.

The command I gave you is for a batch file that is listed in one of the URL (hyperlink) I also posted. Please take a look at the other 2 links I posted and print them out to review them.

Hopefully you can modify the code based on those post, but if not please post again and I will try to help you more specifically on this posting.

Basically I think you have the script working except for the fact that you now need to share you users home folders. That is what the other posts should show you how to do it.

Top
#11664 - 2001-08-23 09:16 AM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
Anonymous
Unregistered


Does this help?
http://www.scriptlogic.com/support/teknotes/s1042.asp

Top
#11665 - 2001-08-23 10:34 AM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
NTDOC Administrator Offline
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
#11666 - 2001-08-23 05:08 PM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Omega - a little trial and error and you would have determined and solved this issue from the info I provided. Normally 'comspec /c' used to insure using client command interpretor (sp?) with SHELL commands, but unnecessary with NET USE.

Bill

SELECT
CASE (@INWIN = 1) AND (@DOS >= 5) SHELL "NET USE H: \\Server\Users\@USERID"
CASE (@INWIN = 1) AND (@DOS >= 4) SHELL "SUBST H: \\Server\Users\@USERID"
CASE (1) SHELL "NET USE H: /HOME"
ENDSELECT

Top
#11667 - 2001-08-23 10:03 PM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Hi Bill,

Maybe I'm wrong, but I think Omegawulf has the script working except that he does not have his user's folders shared.

Your examples for NT/2000 should work fine, but for the Windows 9x clients the /HOME will not work if the folder is not shared.
He must share the folders for Win9x clients to be able to map to it.
Then if they are shared you don't need to do anything in the script for NT/2000 as the home folder will be automatically mapped to the given drive in User Manager. The Windows 9x clients will still need to be told to map the home folder via the logon script though.

Top
#11668 - 2001-08-24 03:03 AM Re: PLEASE HELP WITH MAPPING HOME DIRECTORY
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
NTDOC -
Finally, I know more than you !! I should have saved post #300 to memorialize this feat!

The share is not an issue - the PROFILE under the User Manager must define the drive and path for this to function. All my users home drives are shared as hidden. Just removed one users share and tested - worked fine. If you try on your network I think you will find this works for you also.

Now, can Win9x work without a root share (i.e. \\Server\HOME)? That I do not know.

Bill 'Ego Getting Bigger by the Moment'

[ 24 August 2001: Message edited by: bleonard ]

Top
Page 1 of 3 123>


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

Who's Online
0 registered and 255 anonymous users online.
Newest Members
Timothy, Jojo67, MaikSimon, kvn317, kixtarts2025
17874 Registered Users

Generated in 0.067 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org