locked
How to change the DFS Targets in Bulk? RRS feed

  • Question

  • So.  I have about 1000 DFS targets all pointing to various folders on ServerA.  We are moving Netapp filers,  and this data will move to the same folder names on ServerB.

    I don't want to go through and change these by hand!.  I have thought I might just Export the XML config, and find & Replace all ServerA for ServerB and re-Import?

    So THIS:-

    <Link Name="Obsolescence Working Group" State="1" Timeout="300" >
    <Target Server="ServerA" Folder="groupdata\Obsolescence Working Group" State="2" />
    </Link>

    Would Become THIS :-

    <Link Name="Obsolescence Working Group" State="1" Timeout="300" >
    <Target Server="ServerB" Folder="groupdata\Obsolescence Working Group" State="2" />
    </Link>

    Will this work?  Or do I need to do some fancier scripting?.

    Tuesday, October 15, 2019 10:54 AM

All replies

  • What have you tried? I see no script. Do you understand what a script is. XML is not script it is a data file.

    You can use many tools to update XML.  Use PowerShell to edit the XML.

    Search for blogs that can teach you how to use XML with PowerShell.


    \_(ツ)_/

    Tuesday, October 15, 2019 12:39 PM
  • HI JRV.

     Thanks for the response.

     So far I have not tried anything.  The workplace is very risk averse,  so want cast iron guarantees that something will work, before committing to allow it........

    I have looked at the following DFSUtil command,  to export the XML Config for our Namespace, in the hope that I could then Import it back with the names of the targets,  changed to the new location.

    dfsutil /root:\\DOMAIN.local\groupdata /export:c:\temp\groupdata.xml

    this produces a XML file,  which I can find & Replace all ServerA for ServerB..

    Then Import it again using

    dfsutil /root:\\DOMAIN.local\groupdata /import:c:\temp\groupdata.xml /set

    I'm just not sure if this is the best route,  or if a Powershell script to find and replace the ServerA would be the way to go?.

    Thanks.

    Tuesday, October 15, 2019 12:58 PM
  • This is not a DFS forum so you will have to post there to learn how to use DFS as you need it.  This forum is for admin scripting questions only.

     

    \_(ツ)_/

    Tuesday, October 15, 2019 1:25 PM