视频的容积 发表于 2018-9-2 10:15:06

Powershell DSC 5.0 - Pull 模式 (HTTPS)

configuration HTTPSPullServer  
{
  
    # Modules must exist on target pull server
  
    Import-DSCResource -ModuleName xPSDesiredStateConfiguration
  
    Node sydit01
  
    {
  
      WindowsFeature DSCServiceFeature
  
      {
  
            Ensure = "Present"
  
            Name   = "DSC-Service"
  
      }
  
      WindowsFeature IISConsole {
  
            Ensure = "Present"
  
            Name   = "Web-Mgmt-Console"
  
      }
  
      xDscWebService PSDSCPullServer
  
      {
  
            Ensure                  = "Present"
  
            EndpointName            = "PSDSCPullServer"
  
            Port                  = 8080
  
            PhysicalPath            = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer"
  
            CertificateThumbPrint   = '56B5DC192DE9AB004AE6FB3C96F7C00684537028'
  
            ModulePath            = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
  
            ConfigurationPath       = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"
  
            State                   = "Started"
  
            DependsOn               = "DSCServiceFeature"
  
      }
  
      xDscWebService PSDSCComplianceServer
  
      {
  
            Ensure                  = "Present"
  
            EndpointName            = "PSDSCComplianceServer"
  
            Port                  = 9080
  
            PhysicalPath            = "$env:SystemDrive\inetpub\wwwroot\PSDSCComplianceServer"
  
            CertificateThumbPrint   = "AllowUnencryptedTraffic"
  
            State                   = "Started"
  
            IsComplianceServer      = $true
  
            DependsOn               = ("DSCServiceFeature","PSDSCPullServer")
  
      }
  
    }
  
}
  
# Generate MOF
  
HTTPSPullServer -OutputPath C:\DSC\HTTPS


页: [1]
查看完整版本: Powershell DSC 5.0 - Pull 模式 (HTTPS)