-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from PowerShell/dev
Release of version 4.1.0.0 of DFSDsc
- Loading branch information
Showing
11 changed files
with
589 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Code of conduct | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) | ||
or contact [[email protected]](mailto:[email protected]) with any additional | ||
questions or comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
Modules/DFSDsc/Examples/Resources/DFSReplicationGroup/4_HubAndSpoke.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<# | ||
.EXAMPLE | ||
Create a Hub and Spoke style DFS Replication Group called WebSite | ||
containing one Hub member and one or more Spoke members. The name of | ||
the Hub computer is passed in the HubComputerName parameter and | ||
defaults to 'Hub'. The Hub member contains a folder called WebSiteFiles | ||
with the path 'd:\inetpub\wwwroot\WebSiteFiles'. This path is | ||
replicated to all members of the SpokeComputerName parameter array | ||
into the 'd:\inetpub\wwwroot\WebSiteFiles' folder. The spoke | ||
computers are passed in the SpokeComputerName parameter and | ||
defaults to 'Spoke1', 'Spoke2' and 'Spoke3'. | ||
#> | ||
Configuration Example | ||
{ | ||
param | ||
( | ||
[Parameter()] | ||
[System.String[]] | ||
$NodeName = 'localhost', | ||
|
||
[Parameter()] | ||
[PSCredential] | ||
$Credential, | ||
|
||
[Parameter()] | ||
[System.String] | ||
$HubComputerName = 'Hub', | ||
|
||
[Parameter()] | ||
[System.String[]] | ||
$SpokeComputerName = @('Spoke1','Spoke2','Spoke3') | ||
) | ||
|
||
Import-DscResource -Module DFSDsc | ||
|
||
Node $NodeName | ||
{ | ||
<# | ||
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 RGWebSite | ||
{ | ||
GroupName = 'WebSite' | ||
Description = 'Files for web server' | ||
Ensure = 'Present' | ||
Members = @() + $HubComputerName + $SpokeComputerName | ||
Folders = 'WebSiteFiles' | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = '[WindowsFeature]RSATDFSMgmtConInstall' | ||
} # End of RGWebSite Resource | ||
|
||
DFSReplicationGroupFolder RGWebSiteFolder | ||
{ | ||
GroupName = 'WebSite' | ||
FolderName = 'WebSiteFiles' | ||
Description = 'DFS Share for replicating web site files' | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = '[DFSReplicationGroup]RGWebSite' | ||
} # End of RGWebSiteFolder Resource | ||
|
||
DFSReplicationGroupMembership RGWebSiteMembershipHub | ||
{ | ||
GroupName = 'WebSite' | ||
FolderName = 'WebSiteFiles' | ||
ComputerName = $HubComputerName | ||
ContentPath = 'd:\inetpub\wwwroot\WebSiteFiles' | ||
PrimaryMember = $true | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = '[DFSReplicationGroupFolder]RGWebSiteFolder' | ||
} # End of RGWebSiteMembershipHub Resource | ||
|
||
# Configure the connection and membership for each Spoke | ||
foreach ($spoke in $SpokeComputerName) | ||
{ | ||
DFSReplicationGroupConnection "RGWebSiteConnection$spoke" | ||
{ | ||
GroupName = 'WebSite' | ||
Ensure = 'Present' | ||
SourceComputerName = $HubComputerName | ||
DestinationComputerName = $spoke | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = '[DFSReplicationGroupFolder]RGWebSiteFolder' | ||
} # End of RGWebSiteConnection$spoke Resource | ||
|
||
DFSReplicationGroupMembership "RGWebSiteMembership$spoke" | ||
{ | ||
GroupName = 'WebSite' | ||
FolderName = 'WebSiteFiles' | ||
ComputerName = $spoke | ||
ContentPath = 'd:\inetpub\wwwroot\WebSiteFiles' | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = "[DFSReplicationGroupConnection]RGWebSiteConnection$spoke" | ||
} # End of RGWebSiteMembership$spoke Resource | ||
} | ||
} # End of Node | ||
} # End of Configuration |
104 changes: 104 additions & 0 deletions
104
Modules/DFSDsc/Examples/Resources/DFSReplicationGroupConnection/2_HubAndSpoke.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<# | ||
.EXAMPLE | ||
Create a Hub and Spoke style DFS Replication Group called WebSite | ||
containing one Hub member and one or more Spoke members. The name of | ||
the Hub computer is passed in the HubComputerName parameter and | ||
defaults to 'Hub'. The Hub member contains a folder called WebSiteFiles | ||
with the path 'd:\inetpub\wwwroot\WebSiteFiles'. This path is | ||
replicated to all members of the SpokeComputerName parameter array | ||
into the 'd:\inetpub\wwwroot\WebSiteFiles' folder. The spoke | ||
computers are passed in the SpokeComputerName parameter and | ||
defaults to 'Spoke1', 'Spoke2' and 'Spoke3'. | ||
#> | ||
Configuration Example | ||
{ | ||
param | ||
( | ||
[Parameter()] | ||
[System.String[]] | ||
$NodeName = 'localhost', | ||
|
||
[Parameter()] | ||
[PSCredential] | ||
$Credential, | ||
|
||
[Parameter()] | ||
[System.String] | ||
$HubComputerName = 'Hub', | ||
|
||
[Parameter()] | ||
[System.String[]] | ||
$SpokeComputerName = @('Spoke1','Spoke2','Spoke3') | ||
) | ||
|
||
Import-DscResource -Module DFSDsc | ||
|
||
Node $NodeName | ||
{ | ||
<# | ||
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 RGWebSite | ||
{ | ||
GroupName = 'WebSite' | ||
Description = 'Files for web server' | ||
Ensure = 'Present' | ||
Members = @() + $HubComputerName + $SpokeComputerName | ||
Folders = 'WebSiteFiles' | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = '[WindowsFeature]RSATDFSMgmtConInstall' | ||
} # End of RGWebSite Resource | ||
|
||
DFSReplicationGroupFolder RGWebSiteFolder | ||
{ | ||
GroupName = 'WebSite' | ||
FolderName = 'WebSiteFiles' | ||
Description = 'DFS Share for replicating web site files' | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = '[DFSReplicationGroup]RGWebSite' | ||
} # End of RGWebSiteFolder Resource | ||
|
||
DFSReplicationGroupMembership RGWebSiteMembershipHub | ||
{ | ||
GroupName = 'WebSite' | ||
FolderName = 'WebSiteFiles' | ||
ComputerName = $HubComputerName | ||
ContentPath = 'd:\inetpub\wwwroot\WebSiteFiles' | ||
PrimaryMember = $true | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = '[DFSReplicationGroupFolder]RGWebSiteFolder' | ||
} # End of RGWebSiteMembershipHub Resource | ||
|
||
# Configure the connection and membership for each Spoke | ||
foreach ($spoke in $SpokeComputerName) | ||
{ | ||
DFSReplicationGroupConnection "RGWebSiteConnection$spoke" | ||
{ | ||
GroupName = 'WebSite' | ||
Ensure = 'Present' | ||
SourceComputerName = $HubComputerName | ||
DestinationComputerName = $spoke | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = '[DFSReplicationGroupFolder]RGWebSiteFolder' | ||
} # End of RGWebSiteConnection$spoke Resource | ||
|
||
DFSReplicationGroupMembership "RGWebSiteMembership$spoke" | ||
{ | ||
GroupName = 'WebSite' | ||
FolderName = 'WebSiteFiles' | ||
ComputerName = $spoke | ||
ContentPath = 'd:\inetpub\wwwroot\WebSiteFiles' | ||
PSDSCRunAsCredential = $Credential | ||
DependsOn = "[DFSReplicationGroupConnection]RGWebSiteConnection$spoke" | ||
} # End of RGWebSiteMembership$spoke Resource | ||
} | ||
} # End of Node | ||
} # End of Configuration |
Oops, something went wrong.