• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 571
  • Last Modified:

DFS and offline users

The current scenario is :
1-DFS is in place to manage folders
2-A user logon script is executed using group policy to map a drive to the DFS root ( net use j: \\DFS ROOT\DFS )

the basic solution works very well but there is an issue when the user is off the network, the scripts gets executed from what you may want to call a cached group policy  , which is eventually causing delyas during startup and performance issues since the DFS Is offline.

My  questions :
1-Are there any better ways to map the DFS to a drive?
2-Is there a way to check if the DFS is contactable before attemtping to mount the drive?
0
RBedewi
Asked:
RBedewi
  • 4
  • 3
4 Solutions
 
AwinishCommented:
0
 
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
If you would like to use offline files then you might want to make the drive mapping persistent. That way it doesn't have to try and connect each time the user logs on.

net use j: \\DFS ROOT\DFS /PERSISTENT:YES

If you don't need to use the files offline then you could use the script below. It should only try and map the drive if it gets a response from the root.
Set _DFSROOT=DFS ROOT

ping -n 1 %_DFSROOT% | findstr TTL= > Nul
If %ERRORLEVEL% EQU 0 (Set _LAN=1) Else (Set _LAN=0)

If %_LAN%==1 (
  net use j: \\DFS ROOT\DFS
)

Open in new window

0
 
RBedewiAuthor Commented:
Many thanks "My Username".

1-Are there any better ways to map the DFS to a drive??

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Well you could use VBS to connect the mapped drive. I don't know if it will be any better?

What exactly are you looking for? Are we barking up the wrong tree? When do the delays come in? Is it the script taking a long time or is GP processing taking a long time?
Set objNet = WScript.CreateObject("WScript.Network")
                                             
objNet.MapNetworkDrive "J:","\\DFS ROOT\DFS",False
'                                            ^
'         "False" means it is not persistant | 
'  Change it to "true" to make it persistant |

Open in new window

0
 
RBedewiAuthor Commented:
well basically, we've have noticed that offline computers use cached vbs scripts to connect to the DFS, which delays the computer startup/login for at least a minute. thats something we would like to eliminate.

Secondly, explore better/more efficient/faster ways to connect to the DFS, basically trying enhance startup time and this is one of the areas that can be looked into.
0
 
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Ah, I see. Well if the scripts are giving you trouble why not first test for connectivity to the domain and only then run the rest of the script? Here's some VBS and batch code to test connectivity.
'***VBS code***
Set objShell = WScript.CreateObject("WScript.Shell")
Set objExec = objShell.Exec("ping -n 1 domain.local")
pingResults = LCase(objExec.StdOut.ReadAll)
If InStr(pingResults, "reply from") = 0 Then
 Wscript.Quit
End If

::***batch code***
Set _domain=domain.local

ping -n 1 %_domain% | findstr TTL= > Nul
If %ERRORLEVEL% EQU 0 (Set _LAN=1) Else (Set _LAN=0)

If NOT %_LAN%==1 (
  exit
)

Open in new window

0
 
RBedewiAuthor Commented:
many thanks and appreciate your help
0
 
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
Glad to :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now