title: net use * /delete /y doesn't resolve error "New-PSDrive : Multiple connections to a server ...."
body: <p>This New-PSDrive command </p>
  
  <pre><code>New-PSDrive -Name Z -PSProvider FileSystem -Root \\$j\share -Credential $credentials -ErrorAction Stop
  </code></pre>
  
  <p>Causes the error </p>
  
  <pre><code>New-PSDrive : Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the 
  server or shared resource and try again
  </code></pre>
  
  <p>I have tried disconnecting all drives first, then creating new drive, </p>
  
  <pre><code>net use * /delete /y
  New-PSDrive -Name Z -PSProvider FileSystem -Root \\$j\share -Credential $credentials -ErrorAction Stop
  </code></pre>
  
  <p>I get the output </p>
  
  <pre><code>You have these remote connections:
                  \\TSCLIENT\C
                  \\TSCLIENT\D
                  \\TSCLIENT\E
                  \\TSCLIENT\I
                  \\TSCLIENT\J
                  \\TSCLIENT\K
                  \\TSCLIENT\L
                  \\TSCLIENT\R
                  \\TSCLIENT\T
  Continuing will cancel the connections.
  
  The command completed successfully.
  
  New-PSDrive : Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the 
  server or shared resource and try again
  </code></pre>
  
  <p>I also tried removing the Z drive first</p>
  
  <pre><code>Remove-PSDrive -name Z
  New-PSDrive -Name Z -PSProvider FileSystem -Root \\$j\share -Credential $credentials -ErrorAction Stop
  </code></pre>
  
  <p>And get error</p>
  
  <pre><code>Remove-PSDrive : Cannot find drive. A drive with the name 'Z' does not exist.
  ...
  New-PSDrive : Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the 
  server or shared resource and try again
  </code></pre>
  
  <p>How to fix?</p>
  
  <p>UPDATE</p>
  
  <p>I even rebooted the machine and changed the drive name, but I still get the same error of "New-PSDrive: Multiple connections ......"</p>
  
  <p>UPDATE 2</p>
  
  <p>I have also tried using IP address instead of computer name, but that doesn't work either, <a href="http://support.microsoft.com/kb/938120" rel="noreferrer">http://support.microsoft.com/kb/938120</a></p>