Learn about Windows PowerShell
Summary: Use Windows PowerShell to remove mapping to a SMB file share.
How can I use Windows PowerShell in Windows 8.1 to remove mapping to an SMB file share?
Use the Remove-SMBMapping cmdlet, specify either the local path or the remote path, and use the –Force parameter to suppress prompts:
Remove-SmbMapping -LocalPath j: -Force
Awesome Tip! More so of the SMB commands than the Remove-SMBMapping cmdlet... I have been struggling to find a way to consistently map drives between AD forests with a specified user account in a script. This solve my PSDrive problems, my Net Use problems, etc.My only issue is that once the script finishes, I do a check to verify the drive is still available, I wait 5 seconds, then do the following: Remove-SmbMapping -LocalPath $DestinationLetter -ForceUnfortunately, it says that the Status of the drive is Unavailable. Luckily I only need to consistently use 5 drives, and you get 26 letters!Thanks again!