Last active
August 29, 2015 14:16
-
-
Save florianbeisel/9274522bc2ea19d41f6e to your computer and use it in GitHub Desktop.
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
configuration ConfigureDSCClient | |
{ | |
param ($NodeId, $PullServer) | |
LocalConfigurationManager | |
{ | |
AllowModuleOverwrite = 'True' | |
ConfigurationID = $NodeId | |
ConfigurationModeFrequencyMins = 60 | |
ConfigurationMode = 'ApplyAndAutoCorrect' | |
RebootNodeIfNeeded = 'True' | |
RefreshMode = 'PULL' | |
DownloadManagerName = 'WebDownloadManager' | |
DownloadManagerCustomData = (@{ServerUrl = "https://$PullServer/psdscpullserver.svc"}) | |
} | |
} |
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
#ContosoWebsite.ps1 | |
Configuration ContosoWebsite | |
{ | |
param ($MachineName) | |
Node $MachineName | |
{ | |
#Install the IIS Role | |
WindowsFeature IIS | |
{ | |
Ensure = "Present" | |
Name = "Web-Server" | |
} | |
#Install ASP.NET 4.5 | |
WindowsFeature ASP | |
{ | |
Ensure = "Present" | |
Name = "Web-Asp-Net45" | |
} | |
} | |
} | |
#ContosoWebsite –MachineName "server2.contoso.com" |
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
#NewPullServer.ps1 | |
configuration NewPullServer | |
{ | |
param | |
( | |
[string[]]$ComputerName = 'localhost' | |
) | |
Import-DSCResource -ModuleName xPSDesiredStateConfiguration | |
Node $ComputerName | |
{ | |
WindowsFeature DSCServiceFeature | |
{ | |
Ensure = "Present" | |
Name = "DSC-Service" | |
} | |
xDscWebService PSDSCPullServer | |
{ | |
Ensure = "Present" | |
EndpointName = "PSDSCPullServer" | |
Port = 8080 | |
PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer" | |
CertificateThumbPrint = "AllowUnencryptedTraffic" | |
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules" | |
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration" | |
State = "Started" | |
DependsOn = "[WindowsFeature]DSCServiceFeature" | |
} | |
xDscWebService PSDSCComplianceServer | |
{ | |
Ensure = "Present" | |
EndpointName = "PSDSCComplianceServer" | |
Port = 9080 | |
PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCComplianceServer" | |
CertificateThumbPrint = "AllowUnencryptedTraffic" | |
State = "Started" | |
IsComplianceServer = $true | |
DependsOn = ("[WindowsFeature]DSCServiceFeature","[xDSCWebService]PSDSCPullServer") | |
} | |
} | |
} | |
#This line actually calls the function above to create the MOF file. | |
#NewPullServer –ComputerName server1.contoso.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found here: http://www.systemcentercentral.com/day-1-intro-to-powershell-dsc-and-configuring-your-first-pull-server/