19

I've been tearing my hair out trying to get Windows to remember the credentials to a network share, and almost all attempts were completely fruitless.

I have two Windows machines, one being a media center that is supposed to access content on the other, but every time it fails to remember the credentials and requires a manual login to the remote share to get things going.

I tried various thing. Adding the credentials to Credential Manager, trying to change the NTLP security level, changing the username/passwords of the two machines to match, and I'm sure I tried other things too, nothing worked.

Acorn
  • 728
  • 1
  • 5
  • 19

4 Answers4

12

This problem seems to stem from Windows attempting the initial connection to a networked drive using the its host's domain (the "Current Domain" in the picture) instead of the network server's domain (the "Desired Domain" in the picture).

For the following example let us assume the username of a user who is authorized to access the network drive is "SomeUsername". If I entered "SomeUsername" into the username field of the box below and then also entered the correct password Windows would connect to the network drive, but when I restated my computer Windows would not remember the username and password, even if I had checked the "Remember my credentials" box. The solution is to change the domain you enter your credentials. As noted in the picture you will need to type "\{DOMAIN}\{USERNAME}" in the username field without entering a password then click OK. For this example I would enter \FREENAS\SomeUsername into the username field, leave the password field blank, then click OK.

enter image description here

After you do that you will get a new pop up that looks like the one below. Enter the correct password, check the "Remember my credentials" box, then click OK. The next time you restart Windows your network drive should reconnect.

enter image description here

One side note, the part where you leave your password blank isn't really necessary, but leaving the password blank as suggested will allow you to clearly see what domain name Windows is going to store with the credentials you enter.

ubiquibacon
  • 8,244
  • 3
  • 31
  • 37
4

Use NET USE with /savecred and /persistent:yes to permanently save the credentials

net use \\Hostname /savecred /persistent:yes
3

Click Start -> Search "Credential Manager" and run it. Click 'Add a Windows credential' and enter your information. Your information will now persist

Rob
  • 31
0

I eventually managed to come up with something that worked!

You need to automatically authenticate to the share each time the machine is started, which can be done with a batch script.

This is what you need in your script:

net use \\theremotemachine ThePassword /user:Username

Based on info from here and here.

Now, I didn't have any luck getting this working using task scheduler for some reason, so I ended up using a program called hstart. It allows you to launch hidden batch scripts.

I created a shorcut, put it in the Startup folder, and changed the Target to:

C:\hstart.exe /NOCONSOLE “C:\script.bat”

And there you go, there should now be no problems accessing the shared folders on the remote machine.

I think there may be a problem if the other machine isn't on when the script runs, but I'm not sure how you could get around that..

Hope someone else finds this useful.

Acorn
  • 728
  • 1
  • 5
  • 19