Asked by:
DFS - Logon script doesn't working

Question
-
Hi everyone,
I added a DFS structure in the company I work for, and I created the NameSpace, Scheduled synchronization between File Servers, etc.
However, yesterday tried to configure logon scripts in our environment by reflecting on the DFS environment, and something wrong happened. I tried to use the logon script in my AD account, but the letter units couldn't be loaded. The printscreen below shows up the error occurred:
Obs.: The logon script I tried to configure is the following example below (vbs script):
Set WSHNetwork = CreateObject("WScript.Network")
UserString = WSHNetwork.UserName
DomainString = WSHNetwork.UserDomain
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
'WSHNetwork.RemoveNetworkDrive "J:",true,true
'WSHNetwork.RemoveNetworkDrive "K:",true,true
'WSHNetwork.RemoveNetworkDrive "L:",true,trueFor Each GroupObj In UserObj.Groups
Select Case GroupObj.Name' Sales Dept
Case "SALES"
WSHNetwork.MapNetworkDrive "J:", "\\MyDomain\DFSNameSpace\Share\FolderName1"
WSHNetwork.MapNetworkDrive "K:", "\\MyDomain\DFSNameSpace\Share\FolderName2"
WSHNetwork.MapNetworkDrive "L:", "\\MyDomain\DFSNameSpace\Share\FolderName3"End Select
Next
WScript.QuitDo you know guys what wrong is happening? How should I configure my logon scripts to reflect DFS Folders?
Thank you.
Tuesday, July 14, 2020 12:29 PM
All replies
-
Hi,
Thanks for sharing here!
To know the issue more clearly, it will be helpful if you can collect the following information :
1,You are try to map a network drive using the DFS path through the logon script, right?
2,Did you try to map the drive manually ,can it be successfully created as following:
This "File Services and Storage" Forum will be migrating to a new home on Microsoft Q&A, please refer to this sticky post for more details.
Best Regards,
Fan
"File Services and Storage" forum will be migrating to a new home on Microsoft Q&A!
We invite you to post new questions in the "File Services and Storage" forum's new home on Microsoft Q&A!
For more information, please refer to the sticky post
- Edited by flingminMicrosoft contingent staff Wednesday, July 15, 2020 1:07 AM
Wednesday, July 15, 2020 1:03 AM -
Hi Fan,
First of all, thank you for answering (again).
Yes, I tried your tip (a few moments ago), and it worked fine for me.
What would be the next step?
Best whishes,
Wednesday, July 15, 2020 11:41 AM -
Hi,
I want to make sure that if there are problems withe DFS-N itself. Since we can manually create mapping drive successfully, then we may test if the the script was working well by changing a network path .
Or you can consider the GPP to set the mapping mapping directly instead of the VBS script,The Group Policy Preference Drive Map extension enables you to configure mapped drives for an enterprise environment without the need of complicated and cumbersome logon scripts.
For your reference:Best Regards,
Fan
Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com
- Proposed as answer by flingminMicrosoft contingent staff Monday, July 27, 2020 11:50 PM
Thursday, July 16, 2020 3:36 AM -
Hey Fan, how's it going?
So, this is exactly the issue. The script is configured just as I had shown in my first quote. Here's an example:
WSHNetwork.MapNetworkDrive "J:", "\\MyDomain\DFSNameSpace\Share\FolderName1
That doesn't work. This is exactly the situation. Btw, I have about a thousand users in my AD environment. All of them mapping network drivers by logon script. I wouldn't like changing the type of mapping to GPO.
There's something wrong with this path. But I don't know what...
Thank you for answering.
Best regards,
Friday, July 17, 2020 6:44 PM -
Hi,
Thanks for your reply!
Just as a test to see if the path has a problem, use the GPP method provided above.If there is no progress, I would suggest you contact Microsoft Customer Services and Support to get an efficient solution:
https://support.microsoft.com/en-in/hub/4343728/support-for-business
Best Regards,
FanPlease remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com
Monday, July 20, 2020 7:10 AM -
Hi Fan,
Everything is working properly right now. I guess the old script was wrong. I made a new script, with the same DFS namespace, and that's working like a charm.
Thank you for helping me.
Have a good one!
Best Regards.
- Proposed as answer by flingminMicrosoft contingent staff Friday, August 7, 2020 7:11 AM
Monday, July 27, 2020 2:17 PM -
Hi,
I am glad to hear that your issue was successfully resolved. If there is anything else we can do for you, please feel free to post in the forum.
Best Regards,
Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com
Monday, July 27, 2020 11:50 PM