Asked by:
A way to stop Windows from triyng to connect to mapped drives on user logon

Question
-
Hello folks,
we are deploying a multifactor authentication (MFA) product in our environment. Some of our users do have WebDAV mapped drives against a Sharepoint Server 2019 OnPremise.
When uers logon to their profiles Windows actually tires to connect to those WebDAV mapped dirves. At this point user has still not been granted acces as access is granted once MFA is completed and this must be done accessing Sharepoint through a web browser.
This fact generates lots of unsuccesfull access attempts in the MFA. Is there a way to stop Windows from triyng to connect (to send credentials) to mapped drives on user logon?
Kindly appreciate your help,
Best regards.
All replies
-
-
-
-
-
The reason you can use this command is because the script works in a way that it will only run when a user logs on (so it won't run when you reboot your machine). This means that if you have mapped drives that are not necessarily used every time you log on, then once your computer starts up again, Windows will try to reconnect to those mapped drives.
-
Navigate to the following location in the Registry. On the right side, double-click on “RestoreConnection“. If this value doesn't exist, right-click the “NetworkProvider” folder, then choose “New” > “DWORD Value“. Give “RestoreConnection” one of the values of “0” to disable the mapped network drive message.
Regards,
Rachel Gomez
-
There are a few different ways you can prevent Windows from trying to connect to the WebDAV mapped drives on user logon when using MFA:
Disconnect the mapped drives: You can use a logon script or a Group Policy Object (GPO) to disconnect the mapped drives when the user logs on. This can be done using the net use command in a logon script.
Disable the WebClient service: The WebClient service is responsible for managing WebDAV connections on Windows. You can use a logon script or GPO to disable this service on the client computers.
Delay the drive mapping: You can configure the logon script or GPO to delay the drive mapping until after the MFA process is complete. This can be done using the "net use" command with the "/persistent:no" option and a delay.
Use a script to check if the user has been granted access before trying to connect the mapped drive: You can use a script to check if the user has been granted access before trying to connect to the mapped drive. If the user has not been granted access, the script can prevent Windows from trying to connect.
Configure a conditional access policy: You can use Azure Conditional Access to ensure that the user must complete MFA before they can access SharePoint.
It's important to note that the above solutions may not work for all environments and it depends on the specific implementation of the MFA product and the WebDAV mappings.
You may need to test different approaches and find what works best for your environment.
Best of luck. -
-
Hello Txalamar,
You can do this with group policy's
Go to Computer Configuration > Administrative Templates > System > Logon.
Locate the policy setting "Always wait for the network at computer startup and logon.Double-click the policy setting and select "Enabled".
Click OK to save the changes
Hope this helps.
Update: Something you should also know is that once enabled a delay in the logon process may be caused by this, so it might be important to communicate that as well
Or you could use a script like this
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "WaitForNetwork" -Type DWORD -Value 1
- Edited by Noobus96 Monday, February 6, 2023 10:34 PM