共用方式為


Dfsutil Examples

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

DFSUtil Examples

Enabling the insite setting of a DFS server is useful when:

  • You don't want the DFS clients to connect outside the site.

  • You don't want the DFS client to connect to a site other than the site it is in, and hence avoid using expensive WAN links.

dfsutil /insite:\\example.com\dfsroot /enable

After using this command statement, clients will not get any referral for a replica outside the dfsroot site. This means that if the Replica sets in the client Site are down, the client will not do a failover to a Replica set in another site.

Disabling the insite setting of a DFS server is useful when:

  • You want to enable outside site referrals.

Note

  • If you want your DFS clients to be able to link to outside sites when no local server is available, and the DFS clients never seem to link outside the site, it may be because connectivity has been limited to an internal site using the /insiteenable setting. Disabling this setting will restore the ability of clients to link outside the site.

To reset your site preferences, type the following at the command prompt:

dfsutil /insite:\\example.com\Sales /disable

After using this command statement, clients will also get referrals for servers outside the example.com site. This means that, if all the servers in the client Site are down, the client will do a failover to a server in another site. Be aware that this may require traversing through expensive WAN links.

Example 2: Configure a DFS Server to be Site Cost Aware

You want DFS clients to be able to connect outside the internal site, but you want clients to connect to the closest site first, saving the expensive network bandwidth. You want to maintain high availability as a priority, but obviously you want DFS clients to connect to closer sites rather than farther sites when the former are reachable and up. To configure the server to be site cost aware, type either of the following statements at the command line:

dfsutil /sitecosting:\\example.com\sales /enable

dfsutil /root:\\example.com\sales /sitecosting /enable

Now the server sends the referral list composed of the randomly ranked targets in the same site as the client, followed by the targets in the next closest site from the site in which the client resides, followed by targets in the second closest site, and then the third and so on.

Notes

  • If you do not know if a root is site costing aware, you can check its status by substituting the /display parameter for the /sitecosting parameter.

  • If you want to disable site costing, substitute the /disable parameter for the /enable parameter.

  • If you want additional insight into the processing behind this command, append the /verbose parameter to the end of either command statement.

  • Do not use the /sitecosting parameter in conjunction with the /api parameter. Site costing cannot be done in the API mode.

Example 3: Back up the DFS Namespace

You want to back up the DFS namespace for a specified root so that you can restore it later in case of system crash and loss of namespace from the system. Backing up namespace information is especially important when you have large namespaces. Using a single command statement per root, you can back up the namespaces into simple files. The files are in an XML format. To back up a namespace, type the following at the command line:

dfsutil /root:\\example.com\sales /export:c:\NameSpaceBackups\DateToday\saRoot20.txt

Note

  • The output of the export file is in XML in Windows Server 2003 DFS. This means that, if your current DFS is a prior version and the output file is coming from a prior version, it should be converted to the XML format used by the /import parameter.

Example 4: Restore the DFS Namespace from a Back Up

Your system has crashed and you have lost your namespace data. In order to restore the namespace, type the following at the command line:

dfsutil /root:\\example.com\sales /import:c:\NameSpaceBackups\DateToday\saRoot20.txt /set

Notes

  • It is often advisable to use the /verify option before doing the restore to assess the changes that will be made by the import using either the merge or set parameters. To use the /verify parameter, substitute it for the /set parameter.

  • If you backed up the namespaces of the specified root from an earlier version and not Windows Server 2003, then this restore will not work.

Example 5: Copy a Namespace

You want to set up a backup server with the same namespace configuration as your main DFS server. This means that even if you have to take your main DFS server offline or if it goes down, the backup server can act as the DFS server. To copy one namespace to another, type the following at the command line:

dfsutil /root:\\example.com\sales /importroot:\\example1.com\sales1 /mirror

To verify that the namespace configuration has been mirrored on the backup server, type the following at the command line:

dfsutil /root:\\example.com\sales /importroot:\\example1.com\sales1 /compare /verbose

Note

  • By default, DFSUtil works in direct mode to get or update the DFS metadata. If you want DFSUtil to work in the API mode, use the /api parameter.

Example 6: Force a DFS Client to Get a Target Referral List from the Server

A client benefits from high availability in DFS by getting a list of link target referrals within the same site as well as targets in farther sites. In some cases targets in the closer sites may be inaccessible at the beginning of the client's use, causing the client to successfully failover to a target at a farther site. Once a closer and less expensive target is available, you would like the client to use it. If you do not want to reboot the client to cause a closer site to be selected, type the following at the command line:

dfsutil /pktflush

This command statement flushes the local partition knowledge table (PKT). This forces the client to get the referral list of the targets from the server again. Some of the entries in the PKT may not get flushed, especially if DFS is in the process of using the referrals. Once the PKT is flushed from the client cache, the client gets a new list of referrals from the server and it surely will try accessing the closer targets.

Notes

  • There is no guarantee that the client select a desired target in the same site when there are other equivalent candidates available in the same site.

  • Rebooting the client can replace the need of using the /pktflush parameter.

Example 7: Use Windows 2000 DFS with Windows Server 2003 DFS

You have a domain-based DFS with at least one member server that is a Windows 2000 DFS and at least one that is a Windows Server 2003 DFS. This could happen as a result of using site costing in mixed-mode DFS. It could also result from upgrading from a D-DFS with all member servers as Windows 2000 to one with all member servers as Windows Server 2003. To view what site information is currently kept on the Active Directory (blob), type the following at the command line:

dfsutil /root:\\example.com\Sales /showwin2kstaticsitetable

Now if you create links or roots on this DFS using one of the Windows Server 2003 tools, it never writes the Site Information to the DFS blob because Windows Server 2003 DFS discovers it dynamically. For Windows 2000 to function correctly, however, it needs to have this information on the blob it reads. To write links and roots to the blob which will allow Windows 2000 DFS to function properly, type the following at the command line:

dfsutil /root:\\example.com\Sales /updatewin2kstaticsitetable

This command statement updates the site information needed for Windows 2000 DFS to function properly. Repeat this command statement after every addition, deletion, and modification in a link or root on the DFS.

Notes

  • The Windows 2000 DFS uses an Active Directory object to learn about the site information in the DFS blob which in turn is written by the DFS administration tools when the roots and links were created. Windows Server 2003 does not read site information; it determines site information dynamically.

  • The information kept on the blob is static in nature; it is not updated automatically on any changes in DFS.

Example 8: Optimize Active Directory Metadata for Windows Server 2003 DFS

Once you have completed your upgrade of DFS from Windows to Windows Server 2003 and all your DFS roots become Windows Server 2003 servers, the site information details stored in Active Directory are useless. It is good practice to keep the DFS blob optimal for best results and scalability of DFS. To remove this site information from the blob, type the following at the command line:

dfsutil /root:\\example.com\Sales /purgewin2kstaticsitetable

This ensures that the DFS blob will not contain any unnecessary site information.

Example 9: Clean Up a Root-Server Entry in Active Directory

If, for some reason, you have removed a root server and the metadata in Active Directory has not been updated, you can manually cause the root-server entry to be removed from the blob. This parameter is used as a problem/corruption repair setting. Do not confuse it with parameters like /remftroot or /clean. Unless absolutely necessary, use of this parameter should be avoided. To eliminate the resultant obsolete root target in the DFS namespace, type the following at the command line:

dfsutil /unmapftroot /root:\\ex.com\salesdata /server:\\mainshare1

Caution

  • Using this option deletes an entire namespace. This option is used only when you already have removed a domain-based root server. When this command statement is executed, the actual server is never contacted before it unmapped (because it is assumed to have been removed and, as such, would not exist). As a result, a functioning root can get removed accidentally.

Notes

  • The root-server that has been removed must be domain-based for this method to work.

  • DFSUtil works in direct mode to get or update the DFS metadata. This command statement will fail if the root-server is not domain-based or if direct mode cannot be initialized.

  • Back up your namespace before using the /unmapftroot parameter.

See Also

Concepts

Dfsutil Remarks
Dfsutil Syntax
Dfsutil Examples
Alphabetical List of Tools
Topchk.cmd
Rsdir Overview
Rsdiag Overview
Iologsum Overview
Health_chk Overview
Ftonline Overview
Filever Overview
Efsinfo Overview
Dmdiag Overview
Dskprobe Overview
Diruse Overview
Dfsutil Overview
Connstat Overview
Cabarc Overview
Bitsadmin Overview