Skip to content

DFSNamespaceServerConfiguration

dscbot edited this page Feb 14, 2024 · 4 revisions

DFSNamespaceServerConfiguration

Parameters

Parameter Attribute DataType Description Allowed Values
IsSingleInstance Key String Specifies the resource is a single instance, the value must be 'Yes'. Yes
LdapTimeoutSec Write UInt32 Specifies a time-out value, in seconds, for Lightweight Directory Access Protocol (LDAP) requests for the DFS namespace server.
SyncIntervalSec Write UInt32 This interval controls how often domain-based DFS namespace root servers and domain controllers connect to the PDC emulator to get updates of DFS namespace metadata.
EnableSiteCostedReferrals Write Boolean Indicates whether the server can use cost-based selection. Only supported for domain-based DFS namespace servers.
EnableInsiteReferrals Write Boolean Indicates whether this server provides only in-site referrals. Only supported for domain-based DFS namespace servers.
PreferLogonDC Write Boolean Indicates whether to prefer the logon domain controller in referrals. Only supported for domain-based DFS namespace servers.
UseFQDN Write Boolean Indicates whether a DFS namespace server uses FQDNs in referrals.

Description

This resource is used to configure DFS Namespace server settings. This is a single instance resource that can only be used once in a DSC Configuration.

Examples

Example 1

Create a standalone DFS namespace using FQDN called public on the server fileserver1.contoso.com. A namespace folder called brochures is also created in this namespace that targets the \fileserver2.contoso.com\brochures share.

Configuration DFSNamespaceServerConfiguration_Standalone_FQDN_Config
{
    param
    (
        [Parameter()]
        [PSCredential]
        $Credential
    )

    Import-DscResource -ModuleName 'DFSDsc'

    Node localhost
    {
        <#
            Install the Prerequisite features first
            Requires Windows Server 2012 R2 Full install
        #>
        WindowsFeature RSATDFSMgmtConInstall
        {
            Ensure = 'Present'
            Name = 'RSAT-DFS-Mgmt-Con'
        }

        WindowsFeature DFS
        {
            Name = 'FS-DFS-Namespace'
            Ensure = 'Present'
        }

        # Configure the namespace server
        DFSNamespaceServerConfiguration DFSNamespaceConfig
        {
            IsSingleInstance          = 'Yes'
            UseFQDN                   = $true
            PsDscRunAsCredential      = $Credential
        } # End of DFSNamespaceServerConfiguration Resource

        # Configure the namespace
        DFSNamespaceRoot DFSNamespaceRoot_Standalone_Public
        {
            Path                 = '\\fileserver1.contoso.com\public'
            TargetPath           = '\\fileserver1.contoso.com\public'
            Ensure               = 'Present'
            Type                 = 'Standalone'
            Description          = 'Standalone DFS namespace for storing public files'
            PsDscRunAsCredential = $Credential
        } # End of DFSNamespaceRoot Resource

        # Configure the namespace folder
        DFSNamespaceFolder DFSNamespaceFolder_Standalone_PublicBrochures
        {
            Path                 = '\\fileserver1.contoso.com\public\brochures'
            TargetPath           = '\\fileserver2.contoso.com\brochures'
            Ensure               = 'Present'
            Description          = 'Standalone DFS namespace for storing public brochure files'
            PsDscRunAsCredential = $Credential
        } # End of DFSNamespaceFolder Resource
    }
}