?
Solved

Map Network Drive across domain ... script & help needed

Posted on 2005-05-04
12
Medium Priority
?
3,383 Views
Last Modified: 2009-07-29
Guys ...

I am migrating a load of users into a new domain - but they need access to a share called 'cv' on a WORKGROUP called 'Domain' !

I would ultimately like a network drive to be mapped to this location and I assume I would script it ...

But i'm useless at these scripts and not even sure if it's possible ... if someone could write me the script (net use?) I would be appreciated ...

Let's say the users are on 'MyDomain' and need drive 'V:' mapped to a share on ..

'\\domain\fileserver1\cv' with creditials '\\domain\Administrator' and password of 'pw' ...

I hope this makes sense ...

S.S.
0
Comment
Question by:SpencerSteel
  • 7
  • 4
12 Comments
 
LVL 57

Accepted Solution

by:
Pete Long earned 1200 total points
ID: 13928429
These command can be executed from either command line, Batch File OR Login Scripts

This command maps a drive "Z:\" to a shared directory on a server called "Server1"

net use z: \\server1\sharename\

If you need permissions to use this network resource toy can also enter the username and password. (See Security Below)

net use z: \\server1\sharename\ /user:username password

The above commands will work until a user logs out or the machine is rebooted, to make the mapping permanent you need to use a "Persistent switch"

net use z: \\server1\sharename\ /user:username password /Y
0
 
LVL 97

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 800 total points
ID: 13928506
If you have problems with Pete's version of:
net use z: \\server1\sharename\ /user:username password

Try
net use z: \\server1\sharename\ password /user:username

According to NET USE help:
NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
        [/USER:[domainname\]username]
        [/USER:[dotted domain name\]username]
        [/USER:[username@dotted domain name]
        [/SMARTCARD]
        [/SAVECRED]
        [[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]


Most commands can swap order of the functions in the command line - but a few don't and I've always done it password first.
0
 

Author Comment

by:SpencerSteel
ID: 13928507
OK ... this look all correct ... I think my problem lies elsewhere ... namely, I need to connect to

\\domain\server1\sharename

and DOMAIN itself wants a password - I don't think it likes anyone coming in from my domain ... if this server was on the same domain and I could browse to it easily, your method would be spot on ...

... the machine itself is an NT4 box with EVERYONE allowed (Share/Permissions) ... can't think what is obvious that I'm doing wrong.


I wonder if DFS would be better to provide credentials ?

S.S.

0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 57

Expert Comment

by:Pete Long
ID: 13928542
you dont need a domain in thew path as long as the PC can see server by itts name of <server1>

if not

net use v: \\123.123.123.123\share <password> /user:username@the_other_domain_name.com

where 123.123.123.123 is the IP address of server1
0
 

Author Comment

by:SpencerSteel
ID: 13928628
OK ... I can hear everyone muttering 'idiot' under their breath ... and I'm with you ... this all makes sense ... but I think the problem is no longer in the script ...

First of all, the error i'm getting back is basically 'The network name cannot be found' - which is true - it can't ... read on ...

1. As a Administrator from MyNewDomain, using Windows Explorer, I can browse to DOMAIN\Server1 ... but there it stops (no shares can be seen) and asks for Credentials, which I can provide as '\\DOMAIN\Administrator' & 'thepassword' ... then I can see all the shares I might like to connect to - as you would expect.

2. A 'normal' user from my domain does not get challenged at the DOMAIN level ... thus they will never 'see' the share.

So, my problem now isn't really one of scripting/mapping the drive ... it's showing the share from the old domain, so users on the new one can 'see' it.

I think.

I thinking that if the users could 'browse' to the CV folder, the mapping thing will be easy - as your scripts are bang on ... I'm just trying to wrap my head around what "Server1\cv" needs for it's shares to be browseable by users on the NewDomain ...

*cries*

S.S.
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 13928708
>> I can hear everyone muttering 'idiot' under their breath

No one thinks that we are here to help :)

your on two domains that dont trust each other - that being said a computer on domain a cant see a computer on domainb (cause the domains use different DNS - DONT confuse internet DNS with NT Domain DNS - they just look similar :)

still assuming server1 is at 123.123.123.123

from the pc on the OTHER domain can you

ping 123.123.123.123

and get a response, if so

net use v: \\123.123.123.123\share <password> /user:username@the_other_domain_name.com

should get you on
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 13928720
Ive just tried it on my home domain from a workgrouped PC and it worked?
0
 

Author Comment

by:SpencerSteel
ID: 13928726
I am an idiot ... and you are helping ... my statement above (2) was incorrect ... i *can* map - via windows XP - to the share from any user.

Therefore, my scripting must be wrong.

I will hand out points now - as you've all been helpful and get to work on this now !

Thanks so much,

S.S.

(facing manual mapping task, he fears.)
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 13928753
<grin> It never stops it dont matter how much tech you know - theres allways something more complicated and more freaking scary LOL - thats why the experts here dont thing of posters as idiots (well there are a few but thats the eception to the rule mate)

keep us posted
0
 

Author Comment

by:SpencerSteel
ID: 13928757
ARGH !

NOTE THE SPACE BETWEEN THE DRIVE (z:) AND THE '\\'

*runs screaming*

OK - we are there - solved.

So sorry !!!!!!!

S.S.
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 13928766
ThanQ - I'll stay subscribed in case it all explodes in balls of flames <grin>
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 13928800
>>So sorry !!!!!!!

I can remember doing the same myself in the past - I'll lay good money you never make that mistake again - glad you are fixed, and thanks again

Pete
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question