Solved

DFS Mapping through Script Hit or Miss Kixtart

Posted on 2009-04-08
2
1,026 Views
Last Modified: 2012-05-06
Good Evening Everyone,

We recently enabled DFS Sharing creating two roots on a Windows 2003 R2 SP2 Server in a domian.  Each root contains links to various other mappings on the same server.  We chose to use DFS for organizational purposes.  The data is too large to replicate therefore we don't.

Through the use of a login script ... kixtart to be exact, the users OU in AD is discovered and they are mapped accordingly to their DFS root.  We are moving away from Kixtart soon to a pure VB script applied via GPO.  I have attached snipits of code to this article.

Should we be mapping to \\domain.local\root or \\server.domain.local\root where server is the dfs server?  Sometimes the users get the mapping, other times they don't get anything.  They can log off and log back in and the status may change, it may not.  They may log out when they have the drive to see when they return it is gone.  They may log in to no mapping, log off, come back and it's there.  This leads me to believe it is not a permissions issue.

They get their home drive which is mapped through their domain profile.  I am fairly sure that the script runs regardless of the status of the "G:" drive.

Perhaps the issues will go away when we switch to the VB script.  Perhaps its a limitation of Kixtart.  Any guidance will be greatly appreciated. :)  My staff, students, and colleagues thank you in advance for your assistance.  

EDIT: The clients are all Windows XP.  Issues happen regardless of the users OU.
Kixtart Script Snipit

 

	Case InGroup( "All Staff" )

		Use G: /delete

		Use G: "\\server.domain.local\Faculty"

		Label ( 'G:\' , 'Shared Drive' )

 

	Case 1

		Use G: /delete

		Use G: "\\server.domain.local\Students"

		Label ( 'G:\' , 'Shared Drive' )

 

VB Script Snipit - this is not live yet.

strOUPath = objUser.Parent

arrContainers = Split(strOUPath, ",")

arrOU = Split(arrContainers(0), "=")

strOU = arrOU(1)

 

If strOU = "Staff" Then

  strDrive = sharedPathFaculty

Else

  strDrive = sharedPathStudents

End If

 

' Map Group drive

objNetwork.RemoveNetworkDrive sharedDriveLetter

objNetwork.MapNetworkDrive sharedDriveLetter, strDrive

Open in new window

0
Comment
Question by:klyptix
2 Comments
 
LVL 31

Accepted Solution

by:
Henrik Johansson earned 500 total points
ID: 24121510
Using servername in UNC-path takes out the usage of having DFS, so use only domain name without servername in UNC-path.

Add some debugging by using "? @error @serror" for troubleshooting.

Why is 'Case 1' trying to map same drive letter as 'Case inGroup("all staff")'? As I understand the code, it will replace the mapping.

A thaught of the reason for the problem is that the script tries to map the drive immediately after it has begun to remove the old mapping and the system hasn't finished that task. Add a sleep after /delete is worth a try
0
 

Author Comment

by:klyptix
ID: 24131703
I think you may be correct with adding a pause.  I will test and respond soon.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now