Map — Drive From Command Line
To delete all mapped drives at once (common in logoff scripts):
You already have a connection to the same server using different credentials. Disconnect all existing mappings to that server: map drive from command line
In PowerShell, you use the New-PSDrive cmdlet. New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\ServerName\ShareName" -Persist : The drive letter you want to use. -PSProvider : For network drives, this is always FileSystem . -Root : The UNC path to the folder. To delete all mapped drives at once (common
