diff --git a/source/DSCResources/DSC_DFSNamespaceFolder/DSC_DFSNamespaceFolder.psm1 b/source/DSCResources/DSC_DFSNamespaceFolder/DSC_DFSNamespaceFolder.psm1 index 1b95303..8afd49d 100644 --- a/source/DSCResources/DSC_DFSNamespaceFolder/DSC_DFSNamespaceFolder.psm1 +++ b/source/DSCResources/DSC_DFSNamespaceFolder/DSC_DFSNamespaceFolder.psm1 @@ -20,7 +20,7 @@ $script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' Specifies if the DFS Namespace root should exist. .PARAMETER TargetState - Specifies a State for the root of a DFS namespace. + Specifies the state of the DFS namespace folder target. #> function Get-TargetResource { @@ -140,7 +140,7 @@ function Get-TargetResource Specifies if the DFS Namespace root should exist. .PARAMETER TargetState - Specifies the target's referral status. + Specifies the state of the DFS namespace folder target. .PARAMETER Description The description of the DFS Namespace. @@ -426,7 +426,7 @@ function Set-TargetResource Specifies if the DFS Namespace root should exist. .PARAMETER TargetState - Specifies the target's referral status. + Specifies the state of the DFS namespace folder target. .PARAMETER Description The description of the DFS Namespace. diff --git a/source/DSCResources/DSC_DFSNamespaceFolder/DSC_DFSNamespaceFolder.schema.mof b/source/DSCResources/DSC_DFSNamespaceFolder/DSC_DFSNamespaceFolder.schema.mof index 795dd26..9bdc8fb 100644 --- a/source/DSCResources/DSC_DFSNamespaceFolder/DSC_DFSNamespaceFolder.schema.mof +++ b/source/DSCResources/DSC_DFSNamespaceFolder/DSC_DFSNamespaceFolder.schema.mof @@ -4,7 +4,7 @@ class DSC_DFSNamespaceFolder : OMI_BaseResource [Key, Description("Specifies a path for the root of a DFS namespace.")] String Path; [Key, Description("Specifies a path for a root target of the DFS namespace.")] String TargetPath; [Write, Description("Specifies if the DFS Namespace root should exist."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; - [Write, Description("Specifies the target's referral status."), ValueMap{"Offline","Online"}, Values{"Offline","Online"}] String TargetState; + [Write, Description("Specifies the state of the DFS namespace folder target."), ValueMap{"Offline","Online"}, Values{"Offline","Online"}] String TargetState; [Write, Description("The description of the DFS Namespace.")] String Description; [Write, Description("Indicates whether a DFS namespace server provides a client only with referrals that are in the same site as the client.")] Boolean EnableInsiteReferrals; [Write, Description("Indicates whether a DFS namespace uses target failback.")] Boolean EnableTargetFailback; diff --git a/source/DSCResources/DSC_DFSNamespaceRoot/DSC_DFSNamespaceRoot.psm1 b/source/DSCResources/DSC_DFSNamespaceRoot/DSC_DFSNamespaceRoot.psm1 index fb7a0ec..ff6c904 100644 --- a/source/DSCResources/DSC_DFSNamespaceRoot/DSC_DFSNamespaceRoot.psm1 +++ b/source/DSCResources/DSC_DFSNamespaceRoot/DSC_DFSNamespaceRoot.psm1 @@ -20,7 +20,7 @@ $script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US' Specifies if the DFS Namespace root should exist. .PARAMETER TargetState - Specifies a State for the root of a DFS namespace. + Specifies the state of the DFS namespace root target. .PARAMETER Type Specifies the type of a DFS namespace as a Type object. @@ -152,7 +152,7 @@ function Get-TargetResource Specifies if the DFS Namespace root should exist. .PARAMETER TargetState - Specifies a State for the root of a DFS namespace. + Specifies the state of the DFS namespace root target. .PARAMETER Type Specifies the type of a DFS namespace as a Type object. @@ -495,7 +495,7 @@ function Set-TargetResource Specifies if the DFS Namespace root should exist. .PARAMETER TargetState - Specifies a State for the root of a DFS namespace. + Specifies the state of the DFS namespace root target. .PARAMETER Type Specifies the type of a DFS namespace as a Type object. diff --git a/source/DSCResources/DSC_DFSNamespaceRoot/DSC_DFSNamespaceRoot.schema.mof b/source/DSCResources/DSC_DFSNamespaceRoot/DSC_DFSNamespaceRoot.schema.mof index 62135bc..ea346aa 100644 --- a/source/DSCResources/DSC_DFSNamespaceRoot/DSC_DFSNamespaceRoot.schema.mof +++ b/source/DSCResources/DSC_DFSNamespaceRoot/DSC_DFSNamespaceRoot.schema.mof @@ -4,7 +4,7 @@ class DSC_DFSNamespaceRoot : OMI_BaseResource [Key, Description("Specifies a path for the root of a DFS namespace.")] String Path; [Key, Description("Specifies a path for a root target of the DFS namespace.")] String TargetPath; [Write, Description("Specifies if the DFS Namespace root should exist."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; - [Write, Description("Specifies a state for a root target of the DFS namespace."), ValueMap{"Offline","Online"}, Values{"Offline","Online"}] String TargetState; + [Write, Description("Specifies the state of the DFS namespace root target."), ValueMap{"Offline","Online"}, Values{"Offline","Online"}] String TargetState; [Required, Description("Specifies the type of a DFS namespace as a Type object."), ValueMap{"Standalone","DomainV1","DomainV2"}, Values{"Standalone","DomainV1","DomainV2"}] String Type; [Write, Description("The description of the DFS Namespace.")] String Description; [Write, Description("Indicates whether a DFS namespace uses cost-based selection.")] Boolean EnableSiteCosting; diff --git a/source/Examples/Resources/DFSReplicationGroup/5-DFSReplicationGroup_Separate_Simple_Config.ps1 b/source/Examples/Resources/DFSReplicationGroup/5-DFSReplicationGroup_Separate_Simple_Config.ps1 new file mode 100644 index 0000000..f9471ff --- /dev/null +++ b/source/Examples/Resources/DFSReplicationGroup/5-DFSReplicationGroup_Separate_Simple_Config.ps1 @@ -0,0 +1,122 @@ +<#PSScriptInfo +.VERSION 1.0.0 +.GUID 53b67a3b-2508-490f-94e5-844d4be558f6 +.AUTHOR DSC Community +.COMPANYNAME DSC Community +.COPYRIGHT Copyright the DSC Community contributors. All rights reserved. +.TAGS DSCConfiguration +.LICENSEURI https://github.com/dsccommunity/DfsDsc/blob/main/LICENSE +.PROJECTURI https://github.com/dsccommunity/DfsDsc +.ICONURI +.EXTERNALMODULEDEPENDENCIES +.REQUIREDSCRIPTS +.EXTERNALSCRIPTDEPENDENCIES +.RELEASENOTES First version. +.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core +#> + +#Requires -module DfsDsc + +<# + .DESCRIPTION + Create a DFS Replication Group called Public containing members defined separately, + FileServer1 and FileServer2. The Replication Group contains a single folder called Software. + A description will be set on the Software folder and it will be set to exclude the directory Temp + from replication. Create a two-way connection between the two nodes. +#> +Configuration DFSReplicationGroup_Separate_Simple_Config +{ + param + ( + [Parameter()] + [PSCredential] + $Credential + ) + + Import-DscResource -Module DFSDsc + + Node localhost + { + <# + Install the Prerequisite features first + Requires Windows Server 2012 R2 Full install + #> + WindowsFeature RSATDFSMgmtConInstall + { + Ensure = 'Present' + Name = 'RSAT-DFS-Mgmt-Con' + } + + # Configure the Replication Group + DFSReplicationGroup RGPublic + { + GroupName = 'Public' + Description = 'Public files for use by all departments' + Ensure = 'Present' + Folders = 'Software' + PSDSCRunAsCredential = $Credential + DependsOn = '[WindowsFeature]RSATDFSMgmtConInstall' + } # End of RGPublic Resource + + DFSReplicationGroupMember RGPublicMemberFS1 + { + GroupName = 'Public' + ComputerName = 'FileServer1' + Ensure = 'Present' + PSDSCRunAsCredential = $Credential + DependsOn = '[DFSReplicationGroup]RGPublic' + } # End of RGPublicMemberFS1 Resource + + DFSReplicationGroupMember RGPublicMemberFS2 + { + GroupName = 'Public' + ComputerName = 'FileServer2' + Ensure = 'Present' + PSDSCRunAsCredential = $Credential + DependsOn = '[DFSReplicationGroup]RGPublic' + } # End of RGPublicMemberFS2 Resource + + DFSReplicationGroupFolder RGSoftwareFolder + { + GroupName = 'Public' + FolderName = 'Software' + Description = 'DFS Share for storing software installers' + DirectoryNameToExclude = 'Temp' + PSDSCRunAsCredential = $Credential + DependsOn = '[DFSReplicationGroup]RGPublic' + } # End of RGPublic Resource + + DFSReplicationGroupMembership RGPublicSoftwareFS1 + { + GroupName = 'Public' + FolderName = 'Software' + ComputerName = 'FileServer1' + ContentPath = 'd:\Public\Software' + StagingPathQuotaInMB = 4096 + PrimaryMember = $true + PSDSCRunAsCredential = $Credential + DependsOn = '[DFSReplicationGroupMember]RGPublicMemberFS1', '[DFSReplicationGroupFolder]RGSoftwareFolder' + } # End of RGPublicSoftwareFS1 Resource + + DFSReplicationGroupMembership RGPublicSoftwareFS2 + { + GroupName = 'Public' + FolderName = 'Software' + ComputerName = 'FileServer2' + ContentPath = 'e:\Data\Public\Software' + StagingPathQuotaInMB = 4096 + PSDSCRunAsCredential = $Credential + DependsOn = '[DFSReplicationGroupMember]RGPublicMemberFS2', '[DFSReplicationGroupFolder]RGSoftwareFolder' + } # End of RGPublicSoftwareFS2 Resource + + DFSReplicationGroupConnection "RGPublicConnectionFS1" + { + GroupName = 'Public' + Ensure = 'Present' + SourceComputerName = 'FileServer1' + DestinationComputerName = 'FileServer2' + PSDSCRunAsCredential = $Credential + DependsOn = '[DFSReplicationGroupFolder]RGSoftwareFolder' + } # End of RGPublicConnectionFS1 Resource + } # End of Node +} # End of Configuration