Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista Tutorial - how to map network drives on a remote computer ?

Reply
 
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


My System SpecsSystem Spec
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
>
>

My System SpecsSystem Spec
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

My System SpecsSystem Spec
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
My System SpecsSystem Spec
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
>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Remote desktop can not find remote computer Network & Sharing
Remote desktop, two network ports on computer Vista networking & sharing
Hide Vista drives from remote XP computer? Network & Sharing
Missing drives (harddrive, cdrom and maaped network drives) Vista General
remote assistance to local network computer Vista networking & sharing


Vista Forums 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 Ltd

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