- This topic has 1 reply, 2 voices, and was last updated 1 month, 3 weeks ago by
November 25, 2020 at 10:46 pm #274224ParticipantTopics: 2Replies: 14Points: 14Rank: Member
After deciding (perhaps wrongly) that “net use” is not the Powershell way, and that New-PSDrive is the non-preferred older way, I’m trying to use New-SmbMapping to map a drive, but it keeps failing with an existing remembered connection. So I’m doing experiments, as below, and am reduced to finding no explanation and having to ask here … “Why am I seeing the following behavior?!”PowerShell12PS C:\WINDOWS\system32> whoamimydomain\doug
In the above, you can see who I am as I run this experiment.PowerShell12345PS C:\WINDOWS\system32> Get-SmbConnectionServerName ShareName UserName Credential Dialect NumOpens---------- --------- -------- ---------- ------- --------filecab drawer1 MYDOMAIN\doug MYDOMAIN\doug 2.0.2 1
In the above, you can see there’s an existing connection to \\filecab\drawer1. I’m unsure how this connection is being established, although it’s possible I connected to this share at some time in the past, but I can find no evidence via the GUI of being connected.PowerShell12PS C:\WINDOWS\system32> Test-Path "\\filecab\drawer1"True
In the above you can see that, yep, there’s a SMB connection. But when I try to disconnect it…PowerShell12345678PS C:\WINDOWS\system32> Remove-SmbMapping -RemotePath "\\filecab\drawer1"Remove-SmbMapping : No MSFT_SmbMapping objects found with property 'RemotePath' equal to '\\filecab\drawer1'. Verify the value of theproperty and retry.At line:1 char:1+ Remove-SmbMapping -RemotePath "\\filecab\drawer1"+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : ObjectNotFound: (\\filecab\drawer1:String) [Remove-SmbMapping], CimJobException+ FullyQualifiedErrorId : CmdletizationQuery_NotFound_RemotePath,Remove-SmbMapping
If I understand the above, it says the connection that exists doesn’t really exist.
I don’t understand. Hopefully someone here can enlighten me as to what I’m doing wrong. Thanks!
November 27, 2020 at 8:17 am #274575ParticipantTopics: 0Replies: 9Points: 55Rank: Member
The Powershell drives are here:
The UNC Drives are here:
> net use
I Think you have stored the Password in Windows:
The WindowsPasswords for UNC Path (and others) are here:
> rundll32.exe keymgr.dll, KRShowKeyMgr
- You must be logged in to reply to this topic.