Let us explore each of these categories of cmdlets in the same order.
This set of cmdlets provides Get/Set/New/Remove operations (called verbs in PS parlance) on a “DfsnRoot” object – which represents a DFS namespace.
Cmdlet |
Description |
Get-DfsnRoot |
The Get-DfsnRoot cmdlet retrieves the configuration settings for the specified – or all the known - namespaces. |
New-DfsnRoot |
The New-DfsnRoot cmdlet creates a new DFS namespace with the specified configuration settings. |
Set-DfsnRoot |
The Set-DfsnRoot cmdlet modifies the configuration settings for the specified existing DFS namespace. |
Remove-DfsnRoot |
The Remove-DfsnRoot cmdlet deletes an existing DFS namespace. |
Here are a few examples:
PS C:> Get-DfsnRoot –Path \Contoso_fsPublic | Format-List
Path : \Contoso_fsPublic
Description : Standalone test namespace
Type : Standalone
State : Online
Flags : Site Costing
TimeToLiveSec : 300
PS C:> New-DfsnRoot –Path \corp.Contoso.comSales -TargetPath \contoso_fsSales -Type Domainv2 | Format-List
Path : \corp.Contoso.comSales
Description : Domain-based test namespace
Type : Domain V2
State : Online
Flags :
TimeToLiveSec : 300
Note : TargetPath is the path to an SMB share to be used as the root target for this namespace. It is just as easy to create the SMB share using Windows PowerShell, run the following on file server \contoso_fs:
New-Item C:Sales_root_folder –type directory
New-SmbShare –Name Sales –Path C:Sales_root_folder
PS C:> Set-DfsnRoot –Path \corp.Contoso.comSales -EnableRootScalability $true -TimeToLive 400
Path : \corp.Contoso.comSales
Description : Domain-based test namespace
Type : Domain V2
State : Online
Flags : Root Scalability
TimeToLiveSec : 400
PS C:> Remove-DfsnRoot -Path \corp.Contoso.comSales -Force
These cmdlets support the same Get/Set/New/Remove operations, but on root targets. And remember that there can be multiple active root targets for a domain-based DFS namespace (which is why domain-based namespaces are generally the recommended option).
Cmdlet |
Description |
Get-DfsnRootTarget |
The Get-DfsnRootTarget cmdlet by default retrieves all the configured root targets for the specified namespace root, including the configuration settings of each root target. |
New-DfsnRootTarget |
The New-DfsnRootTarget cmdlet adds a new root target with the specified configuration settings to an existing DFS namespace. |
Set-DfsnRootTarget |
The Set-DfsnRootTarget cmdlet sets configuration settings to specified values for a namespace root target of an existing DFS namespace. |
Remove-DfsnRootTarget |
The Remove-DfsnRootTarget cmdlet deletes an existing namespace root target of a DFS namespace. |
Here are a few examples:
PS C:> Get-DfsnRootTarget –Path \corp.Contoso.comSales | Format-List
Path : \corp.Contoso.comSales
TargetPath : \contoso_fsSales
State : Online
ReferralPriorityClass : sitecost-normal
ReferralPriorityRank : 0
Path : \corp.Contoso.comSales
TargetPath : \contoso_fs_2Sales
State : Online
ReferralPriorityClass : sitecost-normal
ReferralPriorityRank : 0
PS C:> New-DfsnRootTarget –Path \corp.Contoso.comSales -TargetPath \contoso_fs_3Sales
Path : \corp.Contoso.comSales
TargetPath : \contoso_fs_3Sales
State : Online
ReferralPriorityClass : sitecost-normal
ReferralPriorityRank : 0
PS C:> Set-DfsnRootTarget –Path \corp.Contoso.comSales -TargetPath \contoso_fs_2Sales -ReferralPriorityClass globallow
Path : \corp.Contoso.comSales
TargetPath : \contoso_fs_2Sales
State : Online
ReferralPriorityClass : global-low
ReferralPriorityRank : 0
PS C:> Remove-DfsnRootTarget -Path \corp.Contoso.comSales –TargetPath \contoso_fs_2Sales
These two cmdlets operate on the namespace server overall – support Get/Set on the “DfsnServerConfiguration” object.
Cmdlet |
Description |
Get-DfsnServerConfiguration |
The Get-DfsnServerConfiguration cmdlet retrieves the configuration settings of the specified DFS namespace server. |
Set-DfsnServerConfiguration |
The Set-DfsnServerConfiguration cmdlet modifies configuration settings for the specified server hosting DFS namespace(s). |
Here are a few examples:
PS C:> Get-DfsnServerConfiguration –ComputerName contoso_fs | Format-List
ComputerName : contoso_fs
LdapTimeoutSec : 30
PreferLogonDC :
EnableSiteCostedReferrals :
EnableInsiteReferrals :
SyncIntervalSec : 3600
UseFqdn : False
PS C:> Set-DfsnServerConfiguration –ComputerName contoso_fs -SyncIntervalSec 7200 | Format-List
ComputerName : contoso_fs
LdapTimeoutSec : 30
PreferLogonDC :
EnableSiteCostedReferrals :
EnableInsiteReferrals :
SyncIntervalSec : 7200
UseFqdn : False
This set of cmdlets operates on a DFS namespace folder path. In addition to Get/Set/New/Remove operations on a “DfsnFolder” object, renaming (Move) is also supported. Further, retrieving (Get), setting (Grant), revoking (Revoke) and removing (Remove) enumerate access on namespace folders is also supported through this set of cmdlets.
Cmdlet |
Description |
New-DfsnFolder |
The New-DfsnFolder cmdlet creates a new folder in an existing DFS namespace with the specified configuration settings. |
Get-DfsnFolder |
The Get-DfsnFolder cmdlet retrieves configuration settings for the specified, existing DFS namespace folder. |
Set-DfsnFolder |
The Set-DfsnFolder cmdlet modifies settings for the specified existing DFS namespace folder with folder targets. |
Move-DfsnFolder |
The Move-DfsnFolder cmdlet moves an existing DFS namespace folder to an alternate specified location in the same DFS namespace. |
Grant-DfsnAccess |
The Grant-DfsnAccess cmdlet grants access rights to the specified user/group account for the specified DFS namespace folder with folder targets. |
Get-DfsnAccess |
The Get-DfsnAccess cmdlet retrieves the currently configured access rights for the specified DFS namespace folder with folder targets. |
Revoke-DfsnAccess |
The Revoke-DfsnAccess cmdlet revokes the right to access a DFS namespace folder with folder targets or enumerate its contents from the specified user or group account. |
Remove-DfsnAccess |
The Remove-DfsnAccess cmdlet removes the specified user/group account from access control list (ACL) of the DFS namespace folder with folder targets |
Remove-DfsnFolder |
The Remove-DfsnFolder cmdlet deletes an existing DFS namespace folder with a folder target. |
Here are some examples for this set of cmdlets:
PS C:> New-DfsnFolder -Path \corp.Contoso.comSalesdata1 -TargetPath \contoso_fsdf1 -Description "My Data set 1" -EnableTargetFailback $true | Format-List
Path : \corp.Contoso.comSalesdata1
Description : My Data set 1
State : Online
Flags : Target Failback
TimeToLiveSec : 300
PS C:> Get-DfsnFolder -Path \corp.Contoso.comSalesdata1 | Format-List
Path : \ corp.Contoso.comSalesdata1
Description : My Data set 1
State : Online
Flags : Target Failback
TimeToLiveSec : 300
PS C:> Set-DfsnFolder -Path \corp.Contoso.comSalesdata1 -EnableInsiteReferrals $true | Format-List
Path : \ corp.Contoso.comSalesdata1
Description : My Data set 1
State : Online
Flags : {Target Failback, Insite Referrals}
TimeToLiveSec : 300
PS C:> Move-DfsnFolder -Path \corp.Contoso.comSalesdata1 -NewPath \corp.Contoso.comSalesdataset1 -Force
PS C:> Grant-DfsnAccess -Path \corp.Contoso.comSalesdataset1 -AccountName ContosoUser22 | Format-List
Path : \corp.Contoso.comSalesdataset1
AccountName : ContosoUser22
AccessType : enumerate
PS C:> Get-DfsnAccess -Path \corp.Contoso.comSalesdataset1 | Format-List
Path : \corp.Contoso.comSalesdataset1
AccountName : ContosoUser22
AccessType : enumerate
Path : \corp.Contoso.comSalesdataset1
AccountName : ContosoUser44
AccessType : enumerate
PS C:> Revoke-DfsnAccess -Path \corp.Contoso.comSalesdataset1 -AccountName ContosoUser22 | Format-List
Path : \corp.Contoso.comSalesdataset1
AccountName : ContosoUser22
AccessType : none
Path : \corp.Contoso.comSalesdataset1
AccountName : ContosoUser44
AccessType : enumerate
PS C:> Remove-DfsnAccess -Path \corp.Contoso.comSalesdataset1 -AccountName ContosoUser22
A Get-DfsnAccess on the same path would now show the following:
Path : \corp.Contoso.comSalesdataset1
AccountName : ContosoUser44
AccessType : enumerate
PS C:> Remove-DfsnFolder -Path \corp.Contoso.comSalesdataset1 -Force
This set of cmdlets operates on one or more folder target(s) of a namespace folder. Specifically, the same four operations Get/Set/New/Remove are supported on the “DfsnFolderTarget” object.
Cmdlet |
Description |
New-DfsnFolderTarget |
The New-DfsnFolderTarget cmdlet adds a new folder target with the specified configuration settings to an existing DFS namespace folder. |
Get-DfsnFolderTarget |
The Get-DfsnFolderTarget cmdlet retrieves configuration settings of folder target(s) of an existing DFS namespace folder. |
Set-DfsnFolderTarget |
The Set-DfsnFolderTarget cmdlet modifies settings for the folder target of an existing DFS namespace folder. |
Remove-DfsnFolderTarget |
The Remove-DfsnFolderTarget cmdlet deletes a folder target of an existing DFS namespace folder. |
Here are some examples for this set of cmdlets:
PS C:> New-DfsnFolderTarget -Path \corp.Contoso.comSalesdataset1 -TargetPath \contoso_fs2df1 | fl
Path : \corp.Contoso.comSalesdataset1
TargetPath : \contoso_fs2df1
State : Online
ReferralPriorityClass : sitecost-normal
ReferralPriorityRank : 0
PS C:> Get-DfsnFolderTarget -Path \corp.Contoso.comSalesdataset1 | fl
Path : \corp.Contoso.comSalesdataset1
TargetPath : \contoso_fsdf1
State : Online
ReferralPriorityClass : sitecost-normal
ReferralPriorityRank : 0
Path : \corp.Contoso.comSalesdataset1
TargetPath : \contoso_fs2df1
State : Online
ReferralPriorityClass : sitecost-normal
ReferralPriorityRank : 0
PS C:> Set-DfsnFolderTarget -Path \corp.Contoso.comSalesdataset1 -TargetPath \contoso_fs2df1 -State Offline | fl
Path : \corp.Contoso.comSalesdataset1
TargetPath : \contoso_fs2df1
State : Offline
ReferralPriorityClass : sitecost-normal
ReferralPriorityRank : 0
PS C:> Remove-DfsnFolderTarget -Path \corp.Contoso.comSalesdataset1 -TargetPath \contoso_fs2df1 -Force
I hope this gave you a decent overview of the new DFSN cmdlets in Windows Server 2012. And hope you will start using them soon!
Just be sure to download the " Windows Server 2012 and Windows 8 client/server readiness cumulative update " before you start working with the DFSN PS cmdlets, as the update includes a couple of fixes related to DFSN PS cmdlets. I am told that this update should be eventually available as a General Distribution Release (GDR) on Windows Update, but why wait? You can download it today and start playing with the cmdlets!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.