Last active
February 4, 2016 16:56
-
-
Save quanghiem/3c3aef05a4a303c81450 to your computer and use it in GitHub Desktop.
DSC NewPullServer
This file contains hidden or 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
# http://www.systemcentercentral.com/day-1-intro-to-powershell-dsc-and-configuring-your-first-pull-server/ | |
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