HCHTech
Well-Known Member
- Reaction score
- 4,384
- Location
- Pittsburgh, PA - USA
This is a small new office, all 6 computers on Win11 Pro 25H2. Like I have done dozens of times in past for other clients, I made a 3-line batch file to map 2 drives, and ran it through our RMM. One drive is on a computer running Quickbooks, and the other drive is a shared folder on the NAS follows:
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
net use q: "\\QBSERVER\CompanyFiles" /user:QBUser XXXXXX /persistent:yes
net use s: \\172.xx.xxx.xx\CompanyShare /user:ShareUser XXXXXXX /persistent:yes
The drives map instantly, but when you reboot, the credentials aren't being saved. The drives are in explorer with the red-X and clicking on them prompts for the credentials. So first, I copy the batch file manually to one of the workstations and add a 'pause' to the end so I can see what's going on. When run, no errors are listed at all and the drives show up in Explorer. Reboot, back to the red-Xes and prompts for credentials when trying to access them anyway.
Ok, so I can jam in the credentials by adding a couple of more lines to the batch, like this:
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
cmdkey /add:QBSERVER /user:QBUser /pass:XXXXXXX
cmdkey /add:172.xx.xxx.xx /user:ShareUser /pass:XXXXXXX
net use q: "\\QBSERVER\CompanyFiles" /user:QBUser XXXXXX /persistent:yes
net use s: \\172.xx.xxx.xx\CompanyShare /user:ShareUser XXXXXXX /persistent:yes
pause
Again, no errors at all, the drives show up instantly in Explorer and you can access them, but after a reboot, they have the red Xes, and when trying to access, you get prompted for credentials. Looking in credentials manager, the two entries are there.
Next try is that since one password has an underscore character and the other one has an asterisk, I added quotes surrounding hte password in the batch file. This shouldn't be the problem though, since it works when the batch file is run, and the drives are mapped successfully. No surprise, this didn't change the symptom.
Next.....I tried doing the mapping using the GUI and checking the "remember my credentials" box manually. SAME RESULT.
I also checked the SIDs just for fun, and all of the computers have different SIDs so that's not the problem either. Also Fast Startup is NOT enabled - we disable that on all computers through our RMM. Deleting the credentials from credential manager and the mapping the drives again doesn't help either. Grabbing at straws, I went into group policy and disabled the Microsoft network client: Digitally sign communications (always) policy. It was previously set to 'Not Defined". Rebooting and trying again to map the drives gives they same symptom. The map credentials don't survive a reboot.
I really don't want to put the batch file with passwords in plain text in the startup group, but I don't think I have any option at this point.
What is going on here?
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
net use q: "\\QBSERVER\CompanyFiles" /user:QBUser XXXXXX /persistent:yes
net use s: \\172.xx.xxx.xx\CompanyShare /user:ShareUser XXXXXXX /persistent:yes
The drives map instantly, but when you reboot, the credentials aren't being saved. The drives are in explorer with the red-X and clicking on them prompts for the credentials. So first, I copy the batch file manually to one of the workstations and add a 'pause' to the end so I can see what's going on. When run, no errors are listed at all and the drives show up in Explorer. Reboot, back to the red-Xes and prompts for credentials when trying to access them anyway.
Ok, so I can jam in the credentials by adding a couple of more lines to the batch, like this:
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
cmdkey /add:QBSERVER /user:QBUser /pass:XXXXXXX
cmdkey /add:172.xx.xxx.xx /user:ShareUser /pass:XXXXXXX
net use q: "\\QBSERVER\CompanyFiles" /user:QBUser XXXXXX /persistent:yes
net use s: \\172.xx.xxx.xx\CompanyShare /user:ShareUser XXXXXXX /persistent:yes
pause
Again, no errors at all, the drives show up instantly in Explorer and you can access them, but after a reboot, they have the red Xes, and when trying to access, you get prompted for credentials. Looking in credentials manager, the two entries are there.
Next try is that since one password has an underscore character and the other one has an asterisk, I added quotes surrounding hte password in the batch file. This shouldn't be the problem though, since it works when the batch file is run, and the drives are mapped successfully. No surprise, this didn't change the symptom.
Next.....I tried doing the mapping using the GUI and checking the "remember my credentials" box manually. SAME RESULT.
I also checked the SIDs just for fun, and all of the computers have different SIDs so that's not the problem either. Also Fast Startup is NOT enabled - we disable that on all computers through our RMM. Deleting the credentials from credential manager and the mapping the drives again doesn't help either. Grabbing at straws, I went into group policy and disabled the Microsoft network client: Digitally sign communications (always) policy. It was previously set to 'Not Defined". Rebooting and trying again to map the drives gives they same symptom. The map credentials don't survive a reboot.
I really don't want to put the batch file with passwords in plain text in the startup group, but I don't think I have any option at this point.
What is going on here?