Server share to DFS Migration without End User intervention

Posted on 2010-01-08
Last Modified: 2013-11-14
Currently we have 2 AD sites and 1 Files server.  The file server is located a site 1.  The files server is named \\ServerA.  All the users at both sites have mapped share of \\ServerA\Share

I want to decomission/replace the ServerA with ServerB at site 1, add Server C to Site 2, and then make a Domain DFS replication & Namespace between ServerB & ServerC.  The question is...... Is there anyway I can make the Namespace shares look like \\ServerA\Share, so that end users will never notice the change?
Question by:Unisys1
    LVL 33

    Expert Comment

    by:Todd Gerbert
    Nope.  Your DFS namespace is going to be \\\DFSNamespace name.

    Although, you can include \\ServerA\Share in your DFS topology, this way either path will work until you re-configure the clients.

    Author Comment

    Is there anyway, perhaps DNS,  to make serverA = "" so the old users drive mappings would work?
    LVL 33

    Expert Comment

    by:Todd Gerbert
    Hmm...I'm not sure, but if you care to wait until Monday I'll happily give it a try on my DFS.

    Do clients access the share via a UNC path, or do they all have drive letters mapped?  If it's a drive letter mapping, then it shouldn't be too much trouble to use a login script to disconnect the old mapping & reconnect to the new path.

    Author Comment

    Thanks tgerbert, I'd love any help you can give.  I am not this Domain's Admin, I was just asked if I could set up a better solution for our 2 WAN linked sites to makeUsers' shares faster, redundant.  Currently all of the shares were set up by someone without using a login script.  I am just doing what I can to make this transition to a better system, seemless.  But.... we will do what is necessary to get this done, and if that means users have to remap drives, then so be it.  I am just trying to avoid this for the ~50+ users.
    LVL 33

    Accepted Solution

    Well, it seems that adding a CNAME in my DNS that points to one the DFS namespace servers seems to work okay.  So, you add a cname serverA =

    Even if the shares were manually connected to a drive letter, using VBScript I think it'd be easy to disconnect'em and re-connect. The script below will check for a drive mapping to the old server, if a drive is mapped to the old server then it is disconnected and the same drive letter is mapped to the new DFS namespace. If there's currently not a mapping to the old server, then a new one is added.

    The "Const" lines at the top just need to be set for your environment, then you could use this as a login script.
    Option Explicit
    Const oldUncPath = "\\oldServer\oldFolder"
    Const newUncPath = "\\\DFS Namespace"
    Const newDriveLetter = "O:" 'If not currently mapped, use this drive letter
    Dim WshNetwork
    Dim currentDrive
    Set WshNetwork = CreateObject("WScript.Network")
    currentDrive = IsConnected(oldUncPath)
    If currentDrive = "" Then
    	WshNetwork.MapNetworkDrive newDriveLetter, newUncPath, True
    	WshNetwork.RemoveNetworkDrive currentDrive, True, True
    	WshNetwork.MapNetworkDrive newDriveLetter, newUncPath, True
    End If
    Function IsConnected(UncPath)
    	Dim i
    	Dim drives
    	Set drives = WshNetwork.EnumNetworkDrives
    	UncPath = Trim(UCase(UncPath))
    	IsConnected = ""
    	For i = 1 To drives.Count - 1 Step 2
    		If UCase(Trim(drives(i))) = UncPath Then		
    			IsConnected = drives(i - 1)
    			Exit Function
    		End If
    End Function

    Open in new window


    Author Comment

    I looked at my problem more and I tried just making a CNAME of ServerA= and I got undesired results of "A duplicate name on the network exists".  Weird.  But taking your script into consideration, I think I'm going have to remap their shares, and a VBScript sounds good.  I will even share it and have the users run the script them selves..... I believe....

    So basically, I will be doing lots of file movements and new DFS folders do minimize our domain shares.  I.E.

    .....will become.....

    And I will use your script to make that happen.  Thanks!

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Introduction You may have a need to setup a group of users to allow local administrative access on workstations.  In a domain environment this can easily be achieved with Restricted Groups and Group Policies. This article will demonstrate how to…
    This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
    This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
    This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…

    730 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

    16 Experts available now in Live!

    Get 1:1 Help Now