Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

how to map network drives on a remote computer ?

Closed Thread
 
Thread Tools Display Modes
Old 08-01-2007   #1 (permalink)
Nicopilami
Guest


 

how to map network drives on a remote computer ?

Hi everybody, i would like to map a new network drive on a remote
computer under an admin account, but i didn't find how i could do it.
Would you have an idea ?

thx
bye
Nico

Old 08-01-2007   #2 (permalink)
RichS
Guest


 

RE: how to map network drives on a remote computer ?

Do you mean you want to map a network drive to a remote machine or you want
to map a network drive from a remote machine to a third machine
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Nicopilami" wrote:

> Hi everybody, i would like to map a new network drive on a remote
> computer under an admin account, but i didn't find how i could do it.
> Would you have an idea ?
>
> thx
> bye
> Nico
>
>

Old 08-02-2007   #3 (permalink)
Jeff
Guest


 

Re: how to map network drives on a remote computer ?

On Aug 2, 12:20 am, Nicopilami <n.chauss...@gmail.com> wrote:
> Hi everybody, i would like to map a new network drive on a remote
> computer under an admin account, but i didn't find how i could do it.
> Would you have an idea ?
>
> thx
> bye
> Nico


I have something like this in my profile, which allows me to map a
network drive if it hasn't been done yet:

& {
if ( !( Test-Path Z: ) )
{
$net = New-Object -ComObject WScript.Network

$password = Read-Host -AsSecureString "Password for mapped
drive"

$bstr =
[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR( $password )
$password =
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto( $bstr )

[System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR( $bstr )

$net.MapNetworkDrive( "Z:", "\\<server>\<share>", "false",
"<username>", $password )
}
}

Maybe this will get you started. The Read-Host stuff is just so I
don't have to hard-code a password in my $profile.

Good luck.

Jeff

Old 08-06-2007   #4 (permalink)
Thomas Lee
Guest


 

Re: how to map network drives on a remote computer ?

In message <1185988823.042667.253450@b79g2000hse.googlegroups.com>,
Nicopilami <n.chaussard@gmail.com> writes
>Hi everybody, i would like to map a new network drive on a remote
>computer under an admin account, but i didn't find how i could do it.
>Would you have an idea ?


net use x: \\foobar\share

Where \\foobar is the server and share is the share name. You can also
do this deeper, e.g.:

net use x:\\foobar\share\folder\folder2\folder3

Where \folder\folder2\folder3 are folders within the share.

you can use net use within a PowerShell script.

Thomas
--
Thomas Lee
doctordns@gmail.com
MVP - Admin Frameworks and Security
Old 08-09-2007   #5 (permalink)
Bruce Sanderson
Guest


 

Re: how to map network drives on a remote computer ?

Mapped network drives are per user things, not per computer things. So, if
the intent is to make a mapped network drive available to anyone that logs
on to a computer, put the appropriate net use command into the All Users
startup folder so it will be executed at every logon.

\\computername\c$\documents and settings\All Users\Start
menu\programs\startup

--
Bruce Sanderson MVP
http://members.shaw.ca/bsanders/
It's perfectly useless to know the right answer to the wrong question.


"Nicopilami" <n.chaussard@gmail.com> wrote in message
news:1185988823.042667.253450@b79g2000hse.googlegroups.com...
> Hi everybody, i would like to map a new network drive on a remote
> computer under an admin account, but i didn't find how i could do it.
> Would you have an idea ?
>
> thx
> bye
> Nico
>



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapped Drives and Remote Desktop randy.lane Vista networking & sharing 2 07-14-2008 06:34 PM
Missing drives (harddrive, cdrom and maaped network drives) Martin Rhodin Vista General 1 02-26-2008 02:20 PM
Vista: This Computer can't connect to the Remote Computer Wes Vista networking & sharing 0 06-20-2007 06:41 PM
Computer Management: Can't connect to a remote computer Paul Vista networking & sharing 0 05-08-2007 06:17 PM
remote assistance to local network computer Chris Cowles Vista networking & sharing 3 04-03-2007 10:09 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50