PowerShell DSC Pull Server返回HTTP 503服务不可用

时间:2014-09-24 22:41:11

标签: powershell dsc

我正在使用PowerShell 5.0 September Preview在VMware Workstation上运行的Windows Server 2012 R2虚拟机上配置PowerShell所需状态配置Pull Server。为了执行DSC Pull Server的配置,我使用的是从Microsoft PowerShell MSDN博客中提取的代码片段,该博客利用了xPSDesiredStateConfiguration模块的xDscWebService DSC资源。

当我尝试测试DSC Pull Server的OData端点时,我收到HTTP 503:Service Unavailable消息。关于如何调试和修复此问题的任何想法?

HTTP 503 Service Unavailable

configuration DscWebService 
{ 
    param 
    ( 
        [ValidateNotNullOrEmpty()] 
        [string] $CertificateThumbPrint = 'AllowUnencryptedTraffic'
    ) 

    Import-DSCResource -ModuleName xPSDesiredStateConfiguration;

    WindowsFeature DSCServiceFeature 
    { 
        Ensure = 'Present';
        Name   = 'DSC-Service';
    } 

    WindowsFeature WinAuth 
    { 
        Ensure = 'Present';
        Name   = 'web-Windows-Auth';    
    } 

    xDscWebService PSDSCPullServer 
    { 
        Ensure                  = 'Present';
        EndpointName            = 'PullSvc'; 
        Port                    = 10100;
        PhysicalPath            = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer";
        CertificateThumbPrint   = $CertificateThumbPrint;
        ModulePath              = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules";
        ConfigurationPath       = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration";
        State                   = 'Started';
        DependsOn               = '[WindowsFeature]DSCServiceFeature';
    } 

    xDscWebService PSDSCConformanceService
    {   
        Ensure                  = 'Present';
        EndpointName            = 'DscConformance';
        Port                    = 10101;
        PhysicalPath            = "$env:SystemDrive\inetpub\wwwroot\PSDSCComplianceServer";
        CertificateThumbPrint   = 'AllowUnencryptedTraffic';
        State                   = 'Started';
        IsComplianceServer      = $true;
        DependsOn               = @('[WindowsFeature]DSCServiceFeature', '[WindowsFeature]WinAuth','[xDSCWebService]PSDSCPullServer') ;
    } 
}  

DscWebService  -ComputerName dsc01.t.loc -OutputPath c:\dsc\PullServer -CertificateThumbPrint 00A2F55847C5523FE6CB0C2EE132C638339EA3A8;
Start-DscConfiguration -Wait -Verbose -Path c:\dsc\PullServer -Force;

1 个答案:

答案 0 :(得分:0)

a 503错误通常表示与网站关联的apppool存在问题。运行以下命令以查看apppools的状态

    Get-ChildItem IIS:\AppPools
相关问题