**DONOTDELETE**
(Lurker)
2001-08-19 01:56 AM
PLEASE HELP WITH MAPPING HOME DIRECTORY

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.

pvds
(Hey THIS is FUN)
2001-08-19 09:21 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

This works on my NT WS

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

GR Peter

**DONOTDELETE**
(Lurker)
2001-08-20 12:21 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Thanks, but that didn't work. Like I said, I have a Windows 98 client, not NT.

LonkeroAdministrator
(KiX Master Guru)
2001-08-20 10:28 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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,

**DONOTDELETE**
(Lurker)
2001-08-21 03:20 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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.

**DONOTDELETE**
(Lurker)
2001-08-21 10:34 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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 ]

NTDOCAdministrator
(KiX Master)
2001-08-21 10:56 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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?

**DONOTDELETE**
(Lurker)
2001-08-22 02:48 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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!

NTDOCAdministrator
(KiX Master)
2001-08-22 03:34 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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 ]

**DONOTDELETE**
(Lurker)
2001-08-22 11:39 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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:

LonkeroAdministrator
(KiX Master Guru)
2001-08-23 12:24 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

@-represents kix-macro's. they are listed in kix-manual.
@ldrive is shorthand to "%logonserver%\netlogon\"


**DONOTDELETE**
(Lurker)
2001-08-22 03:37 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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:
  



bleonard
(Seasoned Scripter)
2001-08-22 11:14 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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 ]

**DONOTDELETE**
(Lurker)
2001-08-23 03:07 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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?

NTDOCAdministrator
(KiX Master)
2001-08-23 04:23 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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.

**DONOTDELETE**
(Lurker)
2001-08-23 09:16 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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


NTDOCAdministrator
(KiX Master)
2001-08-23 10:34 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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.

bleonard
(Seasoned Scripter)
2001-08-23 05:08 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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

NTDOCAdministrator
(KiX Master)
2001-08-23 10:03 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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.

bleonard
(Seasoned Scripter)
2001-08-24 03:03 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

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 ]

**DONOTDELETE**
(Lurker)
2001-08-24 03:14 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

NTDOC, I did look over those links you posted and they were quite interesting. But since those discussions seemed to be between experts at a higher level than I, I couldn't entirely follow it/absorb it. I do plan on printing them out and rereading them at my leisure. But right now I'm trying to get this thing to just work.

BSTYLES--thanks for the info on ScriptLogic. I'll bookmark it for reference, but there's a fee for it involved, I really can't go that route right now.

NTDOC---Oooooh! Ok, so that for /f "Tokens=*"...etc. line wasn't a Kixtart script step, but something to run in a batch file to turn unshared home directories into shares? Duh! It makes sense to me now.

Maybe I should back up a step here and explain myself clearer. NTDOC, would you say the following statement is true?

"THERE IS NO WAY TO MAKE A SCRIPT WITH KIXTART THAT WILL MAP A W9X CLIENT TO HIS HOME DIRECTORY UNLESS THAT DIRECTORY IS A SHARE (OR YOU BUY A 3RD PARTY UTILITY)."

If the above is true then, yes, I have been able to use Kixtart to map a user's home directory that is shared. From everyone's help on here it seems that what I needed to do was use the "USE H: /DELETE" command BEFORE using "USE H: @HOMESHR" command.

However, if it is possible to map to a user's home directory that is NOT a share (but a folder below a share), then I'm still at a loss as to how to do it.

NTDOCAdministrator
(KiX Master)
2001-08-24 03:28 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Bill, Bill, Bill - you right man...


I made a false statement..

I have been sharing my folders for 5 years now, so never tried it your way. I just did it and it does work. As for the Root Share, yes it does need one.

i.e. No share, no connect.

\\MYSERVER\USERS shared, access okay
\\MYSERVER no share... no access for any OS.
so might as well be
\\MYSERVER\%USERNAME$% as the shared
half dozen of one/ half dozen of the other

Or you could be the Admin and use
\\MYSERVER\D$\USERS\user - and that would work also for an Admin but not a regular user.

If your code is working then you must be sharing the USERS main folder - True?
Which would mean if U: was mapped to home, you would have something like:
U: user on SERVER\USERS
and mine would look like
U: user$ on SERVER

If not, then hey I'm on another acid trip and I'll catch you when I get back...

[ 24 August 2001: Message edited by: NTDOC ]

bleonard
(Seasoned Scripter)
2001-08-24 03:35 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Thanks for confirming! I'd say you owe me but I've borrowed to much of your coding handiwork...

As for my code, all users drives are under my own structure - \\server\folder\userid
The subfolder is shared as something other than 'users'.

Bill

[ 24 August 2001: Message edited by: bleonard ]

[ 24 August 2001: Message edited by: bleonard ]

NTDOCAdministrator
(KiX Master)
2001-08-24 03:37 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

I confirmed it. MS and you are right. See my example in the previous reply.

You must map a folder... so for our case, it is just as easy to map a hidden share, but your could do as your example and map USERS and then use a variable for the actual user account name.

bleonard
(Seasoned Scripter)
2001-08-24 03:40 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

I've been working on this issue because I am rolling out the new login script and I want to remove all the server shares. Once fully operational in our offices I plan on removing all the hidden shares (just as you have) and making things a little more manageable.

Bill

NTDOCAdministrator
(KiX Master)
2001-08-24 03:42 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Bill do you have MSN or AOL chat?

What is your account.

magicmkrdl is my AOL

bleonard
(Seasoned Scripter)
2001-08-24 05:37 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

NTDOC -
Sorry, no chatting for me. We strictly limit its usage, and before your query I have never had a need for it.

Also, did you see this tidbit shared by pber today - was news to me but very useful.'
http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=002994

Bill

NTDOCAdministrator
(KiX Master)
2001-08-24 08:18 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Yes, I saw it and was going to reply, but did not. So I will here.

Bill, Bill, Bill.... ego has to now drop down a notch or two. This is normal Windows behavior and known for many years now by many Administrators. this works in most (not all) Windows applications and applets.

But, thats okay... I guess I'm old too

Yeah, I usually don't chat either, but Kyder was able to help me get some stuff done on the fly using chat... Kinda of made me change my mind a little

[ 24 August 2001: Message edited by: NTDOC ]

**DONOTDELETE**
(Lurker)
2001-08-24 09:49 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Ok man.

I translate the portuguese parts of the script for you.
Thank's to believe in my solution.

If you have any doubts about the code, tell me and i explain for you.

[s]

code:
 

;Unmapping User Home Área
? "U:"
Use u: /delete /persistent
If @ERROR = 0
" - OK"
Else
" - Error: @error"
EndIf
; I use the /persistent option to have shure about the integrity of drive map.

? "Mapping @USERID HOME AREA in @WKSTA Workstation"
If (( @WKSTA = "Sultsbase1" ) Or ( @WKSTA = "Sultsbase2") Or ( @WKSTA = "Sultsbase3"))
? "You are 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
; In this part i use the following logic. If the user is connecting in the Citrix Metaframe Servers, the User Home Area will be mapped by another batch file, in all other cases the Kix script will map the User Home Area. This script works very well in my entire network.


Ok, that's it.

It's very simple, but work's well.

[s]

VeNoM

bleonard
(Seasoned Scripter)
2001-08-24 09:49 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

NTDOC -
Sorry to disappoint - ego still big as all Montana

Bill

NTDOCAdministrator
(KiX Master)
2001-08-24 10:24 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Oh! by the way --- Omegawulf are you still with us?

Did/does this answer your questions and or did you get it to work?

and who is Montanna?

I'll get back to my trip now...

[ 24 August 2001: Message edited by: NTDOC ]

**DONOTDELETE**
(Lurker)
2001-08-25 01:59 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

NTDOC--I'm still mulling over the thread you guys got going and it's quite interesting.

As far as getting the home directory to map, I've only been able to get it to work when the home folder is shared. If I'm understanding everyone correctly, it doesn't matter if I map to \\SERVER\BSMITH or \\SERVER\USERS\BSMITH or \\SERVER\USERS\ACCOUNTING\THIRD_ROW\LEFT_SIDE\CUBE_TWO\BSMITH, I will NEVER be able to get the user's H: drive to map to BSMITH unless the folder BSMITH on the server is shared. If BSMITH is not a share, then I cannot map to it on W9x clients.

All this is probably moot now, anyway. I was trying to learn kixtart to get this job I wanted. But I just found out today that the job opening at the company I'm working at (I'm a contractor) was given to someone else. Someone with less experience than me(and I don't have that much!). Someone with far less training. With no certification. Someone with bigger boobs. Oh, and it was someone I TRAINED.

bleonard
(Seasoned Scripter)
2001-08-25 02:44 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Omega -
Sorry about the job - but this is still good info to take with you.

Your understanding is not entirely correct.

For Win9x clients - you must share a 'root' folder that houses all the user home directories directly below this shared folder.

Next, under User Manager you must define a drive and path under Profile Manager for the Win9x clients that points to this share.

For example,
Server = Server1
Share dir = C:\Home
Share name = HOME$
User id = Omega
User home dir = \\Server1\Home$\%USERNAME% --> a/k/a Server1: C:\Home\Omega

Create share HOME$ --> C:\Home
Edit OMEGA's Profile --> H:=\\Server1\Home$\%USERNAME% --> this will create sub-dir 'Omega' on Server1 under C:\Home
Log in as user Omega
Execute commands:
NET USE H: /DEL --> confirm drive not in use
NET USE H: /HOME --> map drive to home share

You will find 'H:' maps properly to the sub dir.

Bill

[ 25 August 2001: Message edited by: bleonard ]

NTDOCAdministrator
(KiX Master)
2001-08-25 03:06 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Well, big boobs are a STRONG selling point. Just ask the TV/Movies that have it plastered on almost every show you see.


SEX sells...

[ 25 August 2001: Message edited by: NTDOC ]

**DONOTDELETE**
(Lurker)
2001-08-25 07:43 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Bill,
That was very well put and explained. However, my problem is that I've tried that and it doesn't work. What you've described is my set up that I had started with before I posted here.

I originally had the home directory set up that way. That is, the location is C:\users\bsmith on server SERVER. USERS was shared as "users," and BSMITH was not shared. In Active Directory Users and Computers (since this is a W2K server), on BSmith's profile page, I had set his home folder to be: \\server\users\%username%

But when I use NET USE U: /home, I get a mapping to USERS and not the BSMITH subfolder. I checked to see that USERS was shared and permissions were correct. It was. I checked to make sure that the BSMITH subfolder was there and that permissions were correct. They were.

So what I'm getting is a mapping to the share and not the subfolder below the share.

Sealeopard
(KiX Master)
2001-08-25 08:04 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

The is the correct behavior. Windows NT can only map a drive to a share, not to a folder below a share. You will need to use SUBST for this altough it is not recommended. If you want your user to have a drive mapped to his folder, then the folder MUST be shared!

E.G.:

\\SERVER\USER1
\\SERVER\USER2
\\SERVER\USER3

I would even use hidden shares (append a $ after the sharename)

Jens

NTDOCAdministrator
(KiX Master)
2001-08-26 12:34 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Bill, I think I'm back from my ACID Trip now

After some further testing I have to rescind my previous statement about your being correct.

1.
For Windows NT yes the SUBST does work.
2.
For Windows 2000 - NET USE \\anyserver\anypath will map root there.
3.
For Windows 9x - It MUST be shared to get ROOT mapping

i.e. on a Windows 9x
C:\>net use p: /home
Drive p: is now connected to \\sm-cag-fp03\users Your home directory is
p:\fmlast.

p:
p:\users
cd fmlast
p:\fmlast

This is what you get when this is in User Manager:
\\sm-cag-fp03\users\fmlast

The %username% is used for creating or editing multiple entries in User Manager
it does not map a Windows NT or 9X system to this folder unless it is shared.

USING \\SM-CAG-FP03\USERS\%USERNAME% while these three users are selected in User Manager
will give you the follwing results.
FMLAST1
FMLAST2
FMLAST3

\\SM-CAG-FP03\USERS\FMLAST1
\\SM-CAG-FP03\USERS\FMLAST2
\\SM-CAG-FP03\USERS\FMLAST3

But only a Windows 2000 will map directly there without Sharing FMLAST1 FMLAST2 & FMLAST3

Omegawolf,

Yes you can do \\SERVER\USERS\ACCOUNTING\THIRD_ROW\LEFT_SIDE\CUBE_TWO\BSMITH

For it to work you need to do this:


Windows 2000 = No entry needed if placed in User Manager as \\SERVER\USERS\ACCOUNTING\THIRD_ROW\LEFT_SIDE\CUBE_TWO\BSMITH

Windows NT 4.0 = SUBST H: \\SERVER\USERS\ACCOUNTING\THIRD_ROW\LEFT_SIDE\CUBE_TWO\BSMITH

Windows 9x = Will not work you must SHARE BSMITH as either BSMITH or BSMITH$ (or a name of your choosing), but
it must be shared. Otherwise if you only shared CUBE_TWO and used
NET USE H: \\SERVER\CUBE_TWO\BSMITH When you map you will be in CUBE_TWO and need to change directory to BSMITH


So, unless your working Magic Bill -- I have tested this till I'm blue in the face and I can Not get it to map as you say.

[ 26 August 2001: Message edited by: NTDOC ]

bleonard
(Seasoned Scripter)
2001-08-26 05:26 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

NTDOC -
Well, ego getting smaller than Monaco...

My tests have all been at the command prompt. When executed there, and then you change drives to the newly mapped drive, you are immediately placed into the users home dir. However, I now understand that within the Windows GUI (Explorer, etc.) this view actually remains at the share level 1 folder up. I do not have an explanation for this discrepency, except to blame MS for all our problems.

Okay - pile on Bill - Gates or Leonard, whichever you prefer.

"Crow-eating-boy for the Northern Hemisphere"

NTDOCAdministrator
(KiX Master)
2001-08-26 11:14 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

No big deal Bill...

Between the two of us though I think this is about the longest thread I have seen on this board.

I nominated you for help on another post where you can make it up.

Great to finally get this ironed out.

Cheers

**DONOTDELETE**
(Lurker)
2001-08-26 06:00 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Well, now that we got that figured out, I'd like to thank everyone for their help, especially Bill and NTDOC. Although I've learned that I have a lot more to learn, it's good to see that I was doing everything correctly and the problem had more to do with a limitation with MS W9x.

I'll probably post again sometime soon if I can't figure out why my Kixtart script won't even run at all on my W2K client (oddly, it'll run fine if I log onto the W2K server Kixtart resides on--but minimized--but won't run at all from a W2K Pro on the network). I think that has something to do with W2K Group Policies, so I'll check that first.

BILL--I see you reside in the Chicagoland area. Would you happen to know anyone who'd be willing to hire an inexperienced but willing to learn jr. level NT Admin? I think I mentioned before that I was passed over for a job opening I wanted where I work for someone less qualified (and did I mentioned it was I who trained this person??). Just thought I'd ask...
-OMEGA

Bryce
(KiX Supporter)
2001-08-26 07:55 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Also another disadvantage to using the %username% in usermanager
to automaticly create userfolders, is that usermanager sets the
security rights to the created folder so that only %username% can
access it and %username% is the folder owner.

These default security rights prevent even domain admins from
accessing these folders, preventing proper backups from being done
(of cource DA's can overwright these security settings).

As for map rooting, the basic rule of thumb that i have always
seen is this.

  • Win9xNET USE can only maproot to a share
  • Winnt
    NET USE Can only maproot to a share

    SUBST can map root to any subfolder of a share, but mappings do
    not show up under a NET USE command.

  • Win2k
    NET USE can map root to any subfolder of a share, and mappings do
    show up under a NET USE command.

Bryce

[ 26 August 2001: Message edited by: Bryce ]

Les
(KiX Master)
2001-08-26 08:10 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Bryce,
Correct me if I'm wrong, but I believe Backup Operators group has the necessary rights to backup stuff Admins lack access to.


Bryce
(KiX Supporter)
2001-08-27 04:10 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

you may be right... i had forgotten about backup operators.....

**DONOTDELETE**
(Lurker)
2001-10-25 10:46 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

A footnote:
We had the opposite problem in WinXP. By default the Home Directory in user manager is map rooted and we needed to revert to the NT mapping. i.e.

Home dir is N: = \\Server\Users\Group\UserID
Share is \\Server\Users (mapped to N
so Home directory is N:\Group\UserID

On WinXP this became:
Home dir same
Share is same
but Home directory is now N:\

There is a registry entry (also in Win2K) of ConnectHomeDirToRoot which the following sets back to the NT style.

code:
 	
WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System","ConnectHomeDirToRoot","1",REG_DWORD)


This was necessary as we use %HomeDrive%%HomePath% which the WinXP system breaks.

gsat
(Fresh Scripter)
2002-01-26 01:56 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

I used the following from the link that NTDOC suggested http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=002950

Used

USE H: ("\\testserver\@userid$")

This worked both on Windows 2000 Server as well as Professional.

Great! Isn't it?? Thanks for all your help!

Great appreciations to bleonard, Alex.H, sealeopard, NTDOC and all@kixtart. I really enjoyed this support! Thanks a million guys..gotto run to fix some more issues..



NTDOCAdministrator
(KiX Master)
2002-01-26 01:58 AM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Your welcome gsat,

But I think you meant from this post.
http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=2&t=002845

Glad we could all help out.

johnewagner
(Fresh Scripter)
2008-11-13 03:56 PM
Re: PLEASE HELP WITH MAPPING HOME DIRECTORY

Yeah Yeah, I know it's an old thread. However this thread popped up when I was researching home directories with Google. Hopefully I can ease the pain for someone else.

We are moving from individual shares to a master share for all users. The script has to work for all users, no matter if they have been migrated or not. I don't trust that AD will map the user, so I force it. However if the script fails or does not run, AD should still present the home directory.

For some reason @HOMESHR and @LongHomeDir are identical if the home share is not a deep path. They are different if the share is a deep path.

I wanted to query the h:\ drive before deleting it, and compare it to the expected deep path, but I gave up. Anyone have any ideas? I left mapping on for testing purposes

Tested on XP, Win2k, and Vista.

John Wagner

Code follows:


;**************************************************************************
; Home Directories
;**************************************************************************
USE H: /delete /persistent
USE G: /delete /persistent

IF EXIST ("@HOMESHR")
? "Home Share mapped to @HOMESHR."
? "Home path is @LongHomeDir."
sleep 10
if @HOMESHR = @LongHomeDir
use H: @HOMESHR
$error = @ERROR
IF $error = 0
? "Home directory mapped to @HOMESHR."
ELSE
? "Home directory @HOMESHR does not exist or you do not have permission to access it."
SLEEP 5
ENDIF
else
$txtDeepMap = @HOMESHR + "\" + @LongHomeDir
USE H: $txtDeepMap
$error = @ERROR
IF $error = 0
? "Home directory mapped to $txtDeepMap."
ELSE
? "Home directory $txtDeepMap does not exist or you do not have permission to access it."
SLEEP 5
ENDIF
ENDIF
ELSE
? "Home directory does not exist."
ENDIF