Problem mapping to a home directory
Author |
Message |
kurtis smit #1 / 13
|
 Problem mapping to a home directory
I have created a login script that is working very nicely, primarily due to this newgroup. My last problem is, how do I map to a home directory. I would appreciate if someone could troubleshoot the code below. Dim Network Set Network = WScript.CreateObject("WScript.Network") Network.MapNetworkDrive "H:", "\\testserver\home\" & Network.UserName & "$" As you can see I using the UserName method but it still doesn't work.
|
Mon, 15 Nov 2004 19:10:15 GMT |
|
 |
AkitaIn #2 / 13
|
 Problem mapping to a home directory
It doesnt work because you are not mapping to the share point. To do this set it in user manager or individually share each users home drive directory. Akita Inu
Quote: > I have created a login script that is working very nicely, > primarily due to this newgroup. > My last problem is, how do I map to a home directory. > I would appreciate if someone could troubleshoot the code > below. > Dim Network > Set Network = WScript.CreateObject("WScript.Network") > Network.MapNetworkDrive "H:", "\\testserver\home\" & > Network.UserName & "$" > As you can see I using the UserName method but it still > doesn't work.
|
Mon, 15 Nov 2004 19:49:21 GMT |
|
 |
AkitaIn #3 / 13
|
 Problem mapping to a home directory
Forgive last reply very late here and just worked a 14 hour day. didnt grasp your whole problem the first time. The problem is MapNetworkDrive method uses UNC which has the format \\ServerName\Sharename Your script has \\Servername\Addedextrahere\sharename Akita Inu
Quote: > I have created a login script that is working very nicely, > primarily due to this newgroup. > My last problem is, how do I map to a home directory. > I would appreciate if someone could troubleshoot the code > below. > Dim Network > Set Network = WScript.CreateObject("WScript.Network") > Network.MapNetworkDrive "H:", "\\testserver\home\" & > Network.UserName & "$" > As you can see I using the UserName method but it still > doesn't work.
|
Mon, 15 Nov 2004 20:03:08 GMT |
|
 |
kurtis smit #4 / 13
|
 Problem mapping to a home directory
Thanks for the reply. I've done that, still doesn't work. I think the problem lies with my script. Has anyone got an example of how to map to a home drive using the UserName method. Quote: >-----Original Message----- >It doesnt work because you are not mapping to the share point. >To do this set it in user manager or individually share each users home >drive directory. >Akita Inu
message
>> I have created a login script that is working very nicely, >> primarily due to this newgroup. >> My last problem is, how do I map to a home directory. >> I would appreciate if someone could troubleshoot the code >> below. >> Dim Network >> Set Network = WScript.CreateObject("WScript.Network") >> Network.MapNetworkDrive "H:", "\\testserver\home\" & >> Network.UserName & "$" >> As you can see I using the UserName method but it still >> doesn't work. >.
|
Mon, 15 Nov 2004 22:23:40 GMT |
|
 |
Pete #5 / 13
|
 Problem mapping to a home directory
Set WshNetwork = WScript.CreateObject("WScript.Network") On Error Resume Next WshNetwork.RemoveNetworkDrive "H:", TRUE, TRUE WshNetwork.MapNetworkDrive "H:", "\\server\home\" & WshNetwork.UserName ----- why do you use a dollar sign on each user's directory? Are you sharing them all out? I don't see the need for sharing them all out when the above script works fine without them all shared out.. (window 2000 tested, i'm not sure about other clients though..)
Quote: > Thanks for the reply. I've done that, still doesn't > work. I think the problem lies with my script. > Has anyone got an example of how to map to a home drive > using the UserName method. > >-----Original Message----- > >It doesnt work because you are not mapping to the share > point. > >To do this set it in user manager or individually share > each users home > >drive directory. > >Akita Inu
> message
> >> I have created a login script that is working very > nicely, > >> primarily due to this newgroup. > >> My last problem is, how do I map to a home directory. > >> I would appreciate if someone could troubleshoot the > code > >> below. > >> Dim Network > >> Set Network = WScript.CreateObject("WScript.Network") > >> Network.MapNetworkDrive "H:", "\\testserver\home\" & > >> Network.UserName & "$" > >> As you can see I using the UserName method but it still > >> doesn't work. > >.
|
Tue, 16 Nov 2004 01:45:04 GMT |
|
 |
MV #6 / 13
|
 Problem mapping to a home directory
Quote: > I have created a login script that is working very nicely, > primarily due to this newgroup. > My last problem is, how do I map to a home directory. > I would appreciate if someone could troubleshoot the code > below. > Dim Network > Set Network = WScript.CreateObject("WScript.Network") > Network.MapNetworkDrive "H:", "\\testserver\home\" & > Network.UserName & "$" > As you can see I using the UserName method but it still > doesn't work.
Questions for you: What happens when it doesn't work? Are there errors? Another path mapped, or maybe none? A coupe of things you should know about this stuff that may make a difference: (1) If you *really* mean "home", make sure that the user account has been set up with a home drive mapping for "H:" and the path; otherwise, it isn't "recognized" as home. (2) You can't root map a nested share - and the $ does nothing for you in this instance, since it doesn't appear to be a share. To get a true root mapping, share each user's home directory out directly. You don't need a $ in the folder name to hide it, you just need a $ at the end of the sharename.
|
Tue, 16 Nov 2004 08:36:22 GMT |
|
 |
Adam D. Barrat #7 / 13
|
 Problem mapping to a home directory
Quote:
[..] >> Set Network = WScript.CreateObject("WScript.Network") >> Network.MapNetworkDrive "H:", "\\testserver\home\" & >> Network.UserName & "$" [..] > (2) You can't root map a nested share - and the $ does nothing for > you in this instance, since it doesn't appear to be a share. To get a > true root mapping, share each user's home directory out directly.
Win2K and XP _will_ allow you to deep map into shares, viz: Z:\>net use * \\mowgli\mp3\queen Drive L: is now connected to \\mowgli\mp3\queen. The command completed successfully. Adam
|
Tue, 16 Nov 2004 13:35:36 GMT |
|
 |
msnews.microsoft.co #8 / 13
|
 Problem mapping to a home directory
Here is a method I've used, it requires the home directory property be set though. Dim sh, fso Set sh = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") If not fso.DriveExists("P") Then sh.run "net use P: /home",0,false End If
Quote: > Thanks for the reply. I've done that, still doesn't > work. I think the problem lies with my script. > Has anyone got an example of how to map to a home drive > using the UserName method.
|
Wed, 17 Nov 2004 00:03:59 GMT |
|
 |
MS-M #9 / 13
|
 Problem mapping to a home directory
So will NT. It was 9x and 16 bit LM methods that could only direct map the share itself. Regardless, it is necessary to have a letter assigned to the home value in User Manager for mapping to HOME. In addition, using the traditional "Net Use" method for mapping the drive would cause an error 85 for NT based systems since it is automatically mapped when the user authenticates. In the script: Dim Network Set Network = WScript.CreateObject("WScript.Network") Network.MapNetworkDrive "H:", "\\testserver\home\" & Network.UserName & "$" Should have worked for all NT users if "\home" itself was shared. Otherwise, if the actual user home was shared, the command would wok best as: Network.MapNetworkDrive "H:", "\\testserver\" & _ Network.UserName & "$" Additionally, the folder name itself probably didn't contain the "$" symbol (which would also cause a failure) but the share did. So, there were really 3 areas for potential error here. Greg Chapman MS-MVP http://www.mousetrax.com MouseTrax Computing Solutions On 31 May 2002 06:35:36 +0100, "Adam D. Barratt" Quote:
>[..] >>> Set Network = WScript.CreateObject("WScript.Network") >>> Network.MapNetworkDrive "H:", "\\testserver\home\" & >>> Network.UserName & "$" >[..] >> (2) You can't root map a nested share - and the $ does nothing for >> you in this instance, since it doesn't appear to be a share. To get a >> true root mapping, share each user's home directory out directly. >Win2K and XP _will_ allow you to deep map into shares, viz: > Z:\>net use * \\mowgli\mp3\queen > Drive L: is now connected to \\mowgli\mp3\queen. > The command completed successfully. >Adam
|
Wed, 17 Nov 2004 01:32:19 GMT |
|
 |
MV #10 / 13
|
 Problem mapping to a home directory
My mistake; I was assuming a Win9x network (and neglected saying so!). I've actually had problems with root mapping on NT LANs before, which has made me studiously avoid them. In fact, I just tried doing a few "Net use" root maps from my XP box against an NT4 and a Win2K server - and promptly discovered that it worked perfectly now! So thanks for the correction - I can now use the pesky thing.
Quote:
> [..] > >> Set Network = WScript.CreateObject("WScript.Network") > >> Network.MapNetworkDrive "H:", "\\testserver\home\" & > >> Network.UserName & "$" > [..] > > (2) You can't root map a nested share - and the $ does nothing for > > you in this instance, since it doesn't appear to be a share. To get a > > true root mapping, share each user's home directory out directly. > Win2K and XP _will_ allow you to deep map into shares, viz: > Z:\>net use * \\mowgli\mp3\queen > Drive L: is now connected to \\mowgli\mp3\queen. > The command completed successfully. > Adam
|
Wed, 17 Nov 2004 05:58:03 GMT |
|
 |
MS-M #11 / 13
|
 Problem mapping to a home directory
Oh don't get me wrong! To paraphrase Jurassic Park, just because you can doesn't mean you should! I don't advise getting in the habit of nesting shares even if Windows servers finally have inheritance. The nesting of shares is the evil part. The ugly price to pay for that evil is when your scripts and mapping paths begin to depend on them. If you're going to do that and are willing to put up with the headache just before you're fired, buy Novell! So, it's far better to regulate the ACLs on subs of a share directly than get in the habit of nesting shares and then attempt to manage that mess. If you don't think it's a problem, wait till your next gung-ho new hire admin comes in and decides to clean the directory structure. The poor sod won't have a chance. Alex, you're right on to be clean from the start of your design. That will minimize the garbage accumulation later and mapping to nested shares constitutes commiting two great messes.<g> Greg On Fri, 31 May 2002 16:58:03 -0500, <Alex K. Angelopoulos (MVP)>
Quote: >My mistake; I was assuming a Win9x network (and neglected saying so!). >I've actually had problems with root mapping on NT LANs before, which has made >me studiously avoid them. In fact, I just tried doing a few "Net use" root maps >from my XP box against an NT4 and a Win2K server - and promptly discovered that >it worked perfectly now! >So thanks for the correction - I can now use the pesky thing.
|
Wed, 17 Nov 2004 10:59:51 GMT |
|
 |
MV #12 / 13
|
 Problem mapping to a home directory
Interesting. It was my understanding that being able to root map was: A Good Thing. Thinking about it, I can see that apart from the nesting issue, *not* depending on nested shares does require you to establish specific shares as the starting point for non-admin network access, and may consequently help with a disciplined approach to network security...
Quote: > Oh don't get me wrong! To paraphrase Jurassic Park, just because you > can doesn't mean you should! > I don't advise getting in the habit of nesting shares even if Windows > servers finally have inheritance. The nesting of shares is the evil > part. The ugly price to pay for that evil is when your scripts and > mapping paths begin to depend on them. If you're going to do that and > are willing to put up with the headache just before you're fired, buy > Novell! > So, it's far better to regulate the ACLs on subs of a share directly > than get in the habit of nesting shares and then attempt to manage > that mess. If you don't think it's a problem, wait till your next > gung-ho new hire admin comes in and decides to clean the directory > structure. The poor sod won't have a chance. > Alex, you're right on to be clean from the start of your design. That > will minimize the garbage accumulation later and mapping to nested > shares constitutes commiting two great messes.<g> > Greg > On Fri, 31 May 2002 16:58:03 -0500, <Alex K. Angelopoulos (MVP)>
> >My mistake; I was assuming a Win9x network (and neglected saying so!). > >I've actually had problems with root mapping on NT LANs before, which has made > >me studiously avoid them. In fact, I just tried doing a few "Net use" root maps > >from my XP box against an NT4 and a Win2K server - and promptly discovered that > >it worked perfectly now! > >So thanks for the correction - I can now use the pesky thing.
|
Wed, 17 Nov 2004 11:35:44 GMT |
|
 |
MS-M #13 / 13
|
 Problem mapping to a home directory
Being able to root map IS a good thing. Creating a share scheme that depends on it is not. Greg Chapman MS-MVP http://www.mousetrax.com MouseTrax Computing Solutions On Fri, 31 May 2002 22:35:44 -0500, <Alex K. Angelopoulos (MVP)>
Quote: >Interesting. It was my understanding that being able to root map was: >A Good Thing. >Thinking about it, I can see that apart from the nesting issue, *not* depending >on nested shares does require you to establish specific shares as the starting >point for non-admin network access, and may consequently help with a disciplined >approach to network security...
|
Thu, 18 Nov 2004 00:44:20 GMT |
|
|
|