network mapping doesn't work after restart when using alternate credentials and mapping established via net use

2

0

I will first describe what does work in a series of steps. And then I'll change a step that should not change the final outcome, but it does.

What works:

  1. Log into Windows on a computer that has not joined the domain. Login using a local account. User is local admin, but this doesn't matter.
  2. From Windows Explorer, select to Connect to a Network share. Enter the UNC and select the option to "use alternate credentials" and "persist connection across logins"
  3. For the alternate credentials, enter a domain user name and password that's required to access the remote share.
  4. Use Windows Explorer to navigate to the new drive mapping and validate that you can view the share.
  5. Restart the computer and log with the same credentials as before, the local user.
  6. Launch Explorer and attempt to view the mapped drive.

This works. The drive was mapped again using the network credentials that were specified when the mapping was originally established. All works fine.

Now, disconnect everything and start the test over. This time, do everything up to the point where you use Windows explorer to map the network drive. Instead, go to a command-prompt (non-elevated) and use the NET USE command When using NET USE, specify on the command line the drive letter, the UNC, the user name (domain+user) and /persistent:yes. But do not specify the password on the command line. After issuing the command, it will prompt you to enter the password of the domain user you specified.

At this point the drive is connected. You can do DIR and it works fine. You can launch Explorer and view the share. All works fine.

Now, restart the computer. Log back in using the same credentials as before. Go to Explorer and you will see that the drive is not connected. If you double click on the drive letter anyway, you'll get the following message:

"An error occurred while reconnecting K: to \kpc\kshare. Microsoft Windows Network: 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. This connection has not been restored"

So clearly, it's thinking that there's more than one connection to that drive. But why? When it's referring to "multiple users", I am thinking it's referring to the domain user (which was specified at the time of the mapping), and the local user. But we never attempted to connect to the share using the local user.

There's nothing unusual about this computer. It's a fresh install of Windows 8.1

I've also tried using the powershell equivalent to "net use", and had the same behavior.

What is it about connecting to a network drive using Windows Explorer that's different than using "net use" ?

Is there a way to automate / script mapping a network drive using Windows Explorer?

UAC is not disabled on this computer. I don't think this is a UAC issue because I'm not attempting to share drive mappings between the elevated and non-elevated session tokens.

Any thoughts?

zumalifeguard

Posted 2015-06-18T16:36:54.030

Reputation: 175

What happens when you use the command net use K: \\kpc\kshare /USER:Domain\Username Password /SAVECRED /PERSISTENT:YES? – I say Reinstate Monica – 2015-06-19T01:37:17.950

Answers

1

Years later I figure out that this can be done via credential manager.

Use cmdkey.exe to add credentials that's use by the network drive mapping system as well accessing remote shares via UNC.

zumalifeguard

Posted 2015-06-18T16:36:54.030

Reputation: 175