3

What is the difference between New-DfsnFolder and New-DfsnFolderTarget?

Both commands require both parameters, -Path and -TargetPath. They create the same thing. A DFS folder with a target.

So what is different?

Daniel
  • 6,940
  • 6
  • 33
  • 64

1 Answers1

2

See below for details and examples. New-DfsnFolder will create a new folder, while New-DfsnFolderTarget will add a target to an existing DFS namespace folder.

Sources: New-DfsnFolder & New-DfsnFolderTarget


New-DfsnFolder - Creates a folder in a DFS namespace.

The New-DfsnFolder cmdlet creates a folder in a Distributed File System (DFS) namespace. Specify the path and a path for a folder target for the new folder. A DFS namespace folder has one or more folder targets that are shared folders on computers. When a client attempts to connect to a folder, the DFS namespace server provides a list of folder targets, called referrals. The server determines the order for referrals and clients attempt to connect to a folder target in the order that the server provides. You can specify settings for the new folder. You can use this cmdlet to enable or disable the following settings:

  • In-site referrals.
  • Target failback.

You can also add a descriptive comment, select the state of the folder and
folder target, and set the Time to Live (TTL) interval for referrals.

Finally, you can specify the priority class and priority rank for referrals.

The command below creates a folder called LegacySoftware in the \\Contoso\AccountingResources namespace. The folder target is \\Contoso-FS\AccountingLegacy. The command enables target failback for the folder. The command includes a description for the new folder.

PS C:\> New-DfsnFolder -Path "\\Contoso\AccountingResources\LegacySoftware" -TargetPath "\\Contoso-FS\AccountingLegacy" -EnableTargetFailback $True -Description "Folder for legacy software." 

New-DfsnFolderTarget - Adds a target to a DFS namespace folder.

The New-DfsnFolderTarget cmdlet adds a target to a Distributed File System (DFS) namespace folder. Specify the DFS namespace folder and the folder target. You can set the state of the DFS namespace target and configure priority class and priority rank for referrals.

A DFS namespace folder has one or more folder targets that are shared folders on computers. When a client attempts to connect to a folder, the DFS namespace server provides a list of folder targets, called referrals. The server determines the order for referrals and clients attempt to connect to a folder target in the order that the server provides.

The command below adds \\Contoso-FS\Software as a target for the DFS namespace folder \\Contoso\AccountingResources\LegacySoftware with a referral priority of global low.

PS C:\> New-DfsnFolderTarget -Path "\\Contoso\AccountingResources\LegacySoftware" -TargetPath "\\Contoso-FS\Software" -ReferralPriorityClass GlobalLow
bentek
  • 2,235
  • 1
  • 15
  • 23
  • To an *existing* DFS folder? Oh man, I never thought about that and New-DfsnFolderTarget does exactly the same as New-DfsnFolder, there is no *existing* DFS folder … and that confused me, I guess. Thank you. – Daniel Oct 22 '15 at 13:57