net use * /delete While net use works everywhere, PowerShell offers richer control and better integration with modern authentication, including Azure AD and certificate-based logins. New-PSDrive for Persistent Mappings PowerShell’s drive cmdlets are primarily for creating session-scoped PSDrives (like HKLM:\ for the registry). However, with the -Persist flag, you can create a standard Windows mapped drive:
| Task | Command | |------|---------| | Map persistent drive | net use Z: \\server\share /persistent:yes | | Map with specific credentials | net use Z: \\server\share /user:DOMAIN\user * | | Delete mapping | net use Z: /delete | | Delete all mappings | net use * /delete | | PowerShell persistent drive | New-PSDrive -Name Z -PSProvider FileSystem -Root \\server\share -Persist | | View all connections | net use |
net use Z: \\server\share This maps the share \\server\share to drive letter Z: . If the share requires authentication, net use will prompt you for a username and password. But you can supply them inline for automation:
But for IT professionals, power users, and automation enthusiasts, the graphical approach is a bottleneck. It’s slow, inconsistent across remote sessions, and impossible to script. The command line—specifically net use and, more recently, PowerShell’s New-PSDrive —offers speed, precision, and repeatability.