net use Z: \\Server01\Projects /user:DOMAIN\john.doe * Alternatively, provide the password in the command (less secure, see security section below):
:: Map department drives net use H: \Fileserver01\HomeFolders%username% net use S: \Fileserver01\Shared\Sales net use P: \PrintServer01\Scans cmd command to map network drive
In the modern IT environment, network drives remain the backbone of data sharing and centralized storage management. While the graphical user interface (GUI) of Windows—using "Map network drive" in File Explorer—is convenient for the average user, the command line offers unparalleled speed, automation, and troubleshooting capabilities. Whether you are a system administrator managing hundreds of workstations or a power user looking to optimize your workflow, mastering the net use command in Command Prompt (CMD) is an essential skill. net use Z: \\Server01\Projects /user:DOMAIN\john
net use Z: "\\Server01\Project Files\Q1 Reports" You can explicitly specify the domain and even the domain controller: net use Z: "\\Server01\Project Files\Q1 Reports" You can
$cred = Get-Credential New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\Server01\Projects" -Credential $cred -Persist Mapping network drives via the command line using net use is a powerful, flexible, and reliable method that every Windows professional should master. From quick one-off mappings to complex automated login scripts, the command line gives you control that the GUI simply cannot match.