How to map a network drive using Windows

Home > Search > How-to
  by

Using the GUI

  1. Select the Windows Start Icon > Computer.
  2. In the top menu of Windows Explorer, select Map network drive.
  3. In the Map Network Drive dialog box, type \\fs.example.com\share and select Finish.  Replace fs.example.com with the domain name or IP address of the share.

Using the command line

  1. Type net use and press enter to view the available drives that can be mapped
  2. Type net use <drive letter>: <UNC path> and press enter (example: net use m: \\fs.example.com\share)
    • Note: the /delete option can be used to disconnect a mapped network drive (example: net use m: /delete)

Using PowerShell

New-PSDrive

# Add a network drive
$pass="Your Password"|ConvertTo-SecureString -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PsCredential('Your Username',$pass)
New-PSDrive -Name X -PSProvider FileSystem -Root \\fs.example.com\share -Credential $Cred -Persist

# List the network drives
Get-PSDrive

# Remove the network drives
Remove-PSDrive -Name X -PSProvider FileSystem

 

net use

$FS2 = "\\fs.example.com\share"
$username = "Your Username"
$password = "Your Password"

net use $FS2 $password /USER:$username  

Username / Password

When mapping the network drive, there may be a prompt to enter a username and password.

 

If the Samba is being used for the share, on the Samba server, use the smbpasswd command to add a users password to the SMB database. You can now connect to the Samba share using the username and password.

[root@server1 ~]# smbpasswd -a jeremy
New SMB password: ********
Retype new SMB password: ********


 

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments