Skip to content

Commit a644406

Browse files
authored
Added DFSR configurations and test data (#220)
1 parent 069eab0 commit a644406

File tree

11 files changed

+196
-1
lines changed

11 files changed

+196
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929
- new composite to add a number of servers to a RDS deployment
3030
- DnsSuffixes
3131
- new resource to configure connection-specific DNS suffixes
32+
- DfsReplicationGroupMembers
33+
- new resource to configure DFSR group members
34+
- DfsReplicationGroupMemberships
35+
- new resource to configure DFSR group memberships
36+
- DfsReplicationGroupConnections
37+
- new resource to configure DFSR replication connections
3238

3339
### Changed
3440

RequiredModules.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
StorageDsc = '5.0.1'
3636
Chocolatey = '0.0.79'
3737
ActiveDirectoryDsc = '6.2.0'
38-
DfsDsc = '4.4.0.0'
38+
DFSDsc = '5.0.1'
3939
WdsDsc = '0.11.0'
4040
xDhcpServer = '3.1.0'
4141
xDscDiagnostics = '2.8.0'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@{
2+
RootModule = 'DfsReplicationGroupConnections.schema.psm1'
3+
4+
ModuleVersion = '0.0.1'
5+
6+
GUID = '6b81b87e-3412-4a22-8b10-f06ef34e985f'
7+
8+
Author = 'NA'
9+
10+
CompanyName = 'NA'
11+
12+
Copyright = 'NA'
13+
14+
DscResourcesToExport = @('DfsReplicationGroupConnections')
15+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
configuration DfsReplicationGroupConnections {
2+
param (
3+
[Parameter(Mandatory = $true)]
4+
[hashtable[]]
5+
$Items
6+
)
7+
8+
<#
9+
DestinationComputerName = [string]
10+
GroupName = [string]
11+
SourceComputerName = [string]
12+
[DependsOn = [string[]]]
13+
[Description = [string]]
14+
[DomainName = [string]]
15+
[Ensure = [string]{ Absent | Present }]
16+
[EnsureCrossFileRDCEnabled = [string]{ Disabled | Enabled }]
17+
[EnsureEnabled = [string]{ Disabled | Enabled }]
18+
[EnsureRDCEnabled = [string]{ Disabled | Enabled }]
19+
[MinimumRDCFileSizeInKB = [UInt32]]
20+
[PsDscRunAsCredential = [PSCredential]]
21+
#>
22+
23+
Import-DscResource -ModuleName PSDesiredStateConfiguration
24+
Import-DscResource -ModuleName DFSDsc
25+
26+
foreach ($item in $items)
27+
{
28+
if ($item.DestinationComputerName -eq $item.SourceComputerName)
29+
{
30+
Write-Warning "DestinationComputerName '$($item.DestinationComputerName)' and SourceComputerName '$($item.SourceComputerName)' cannot be the same. Skipping configuration item."
31+
continue
32+
}
33+
34+
if (-not $item.ContainsKey('Ensure'))
35+
{
36+
$item.Ensure = 'Present'
37+
}
38+
39+
$executionName = "$($item.GroupName)__$($item.SourceComputerName)__$($item.DestinationComputerName)" -replace '[\s(){}/\\:-]', '_'
40+
(Get-DscSplattedResource -ResourceName DFSReplicationGroupConnection -ExecutionName $executionName -Properties $item -NoInvoke).Invoke($item)
41+
}
42+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@{
2+
RootModule = 'DfsReplicationGroupMembers.schema.psm1'
3+
4+
ModuleVersion = '0.0.1'
5+
6+
GUID = 'e37629b2-45e9-43d2-81d9-50b4bbda9f86'
7+
8+
Author = 'NA'
9+
10+
CompanyName = 'NA'
11+
12+
Copyright = 'NA'
13+
14+
DscResourcesToExport = @('DfsReplicationGroupMembers')
15+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
configuration DfsReplicationGroupMembers {
2+
param (
3+
[Parameter(Mandatory = $true)]
4+
[hashtable[]]
5+
$Items
6+
)
7+
8+
<#
9+
ComputerName = [string]
10+
GroupName = [string]
11+
[DependsOn = [string[]]]
12+
[Description = [string]]
13+
[DomainName = [string]]
14+
[Ensure = [string]{ Absent | Present }]
15+
[PsDscRunAsCredential = [PSCredential]]
16+
#>
17+
18+
Import-DscResource -ModuleName PSDesiredStateConfiguration
19+
Import-DscResource -ModuleName DFSDsc
20+
21+
foreach ($item in $items)
22+
{
23+
if (-not $item.ContainsKey('Ensure'))
24+
{
25+
$item.Ensure = 'Present'
26+
}
27+
28+
$executionName = "$($item.ComputerName)__$($item.GroupName)" -replace '[\s(){}/\\:-]', '_'
29+
(Get-DscSplattedResource -ResourceName DFSReplicationGroupMember -ExecutionName $executionName -Properties $item -NoInvoke).Invoke($item)
30+
}
31+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@{
2+
RootModule = 'DfsReplicationGroupMemberships.schema.psm1'
3+
4+
ModuleVersion = '0.0.1'
5+
6+
GUID = '8ed7a563-658b-40bc-8f90-c77ec85b49f1'
7+
8+
Author = 'NA'
9+
10+
CompanyName = 'NA'
11+
12+
Copyright = 'NA'
13+
14+
DscResourcesToExport = @('DfsReplicationGroupMemberships')
15+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
configuration DfsReplicationGroupMemberships {
2+
param (
3+
[Parameter(Mandatory = $true)]
4+
[hashtable[]]
5+
$Items
6+
)
7+
8+
<#
9+
ComputerName = [string]
10+
FolderName = [string]
11+
GroupName = [string]
12+
[ConflictAndDeletedQuotaInMB = [UInt32]]
13+
[ContentPath = [string]]
14+
[DependsOn = [string[]]]
15+
[DfsnPath = [string]]
16+
[DomainName = [string]]
17+
[EnsureEnabled = [string]{ Disabled | Enabled }]
18+
[MinimumFileStagingSize = [string]{ Size128GB | Size128MB | Size128TB | Size16GB | Size16MB | Size16TB | Size1GB | Size1MB | Size1TB | Size256GB | Size256KB | Size256MB | Size256TB | Size2GB | Size2MB | Size2TB | Size32GB | Size32MB | Size32TB | Size4GB | Size4MB | Size4TB | Size512GB | Size512KB | Size512MB | Size512TB | Size64GB | Size64MB | Size64TB | Size8GB | Size8MB | Size8TB }]
19+
[PrimaryMember = [bool]]
20+
[PsDscRunAsCredential = [PSCredential]]
21+
[ReadOnly = [bool]]
22+
[RemoveDeletedFiles = [bool]]
23+
[StagingPath = [string]]
24+
[StagingPathQuotaInMB = [UInt32]]
25+
#>
26+
27+
Import-DscResource -ModuleName PSDesiredStateConfiguration
28+
Import-DscResource -ModuleName DFSDsc
29+
30+
foreach ($item in $items)
31+
{
32+
if (-not $item.ContainsKey('EnsureEnabled'))
33+
{
34+
$item.EnsureEnabled = 'Enabled'
35+
}
36+
37+
$executionName = "$($item.ComputerName)__$($item.FolderName)__$($item.GroupName)" -replace '[\s(){}/\\:-]', '_'
38+
(Get-DscSplattedResource -ResourceName DFSReplicationGroupMembership -ExecutionName $executionName -Properties $item -NoInvoke).Invoke($item)
39+
}
40+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Items:
2+
- GroupName: Public
3+
DomainName: contoso.com
4+
SourceComputerName: server1.contoso.com
5+
DestinationComputerName: server2.contoso.com
6+
- GroupName: Public
7+
DomainName: contoso.com
8+
SourceComputerName: server1.contoso.com
9+
DestinationComputerName: server3.contoso.com
10+
- GroupName: Public
11+
DomainName: contoso.com
12+
SourceComputerName: server1.contoso.com
13+
DestinationComputerName: server4.contoso.com
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Items:
2+
- GroupName: Public
3+
DomainName: contoso.com
4+
ComputerName: server1.contoso.com
5+
- GroupName: Public
6+
DomainName: contoso.com
7+
ComputerName: server2.contoso.com

0 commit comments

Comments
 (0)