PowerShell DSC fails to create application pool with xWebAdminstration

dscpowershell

At the moment we are trying to setup an application pool using PowerShell DSC (WMF5.0) and the xWebAdminstration (v1.15) module. We have, so far, managed to get the client node and pull server to work together successfully using the instruction from https://msdn.microsoft.com/en-us/powershell/dsc/pullserver. Using the script below the client node installs IIS successfully but the application pool is not being created and this is where the issue lies.

Configuration MyWebsite
{
    Import-DscResource -ModuleName xWebAdministration

    Node Webserver
    {
        WindowsFeature IIS
        {
            Ensure="Present"
            Name="Web-Server"
        }
        WindowsFeature Mgmt-Tools 
        {
            Ensure  = "Present"
            Name    = "Web-Mgmt-Tools" 
        }
        WindowsFeature Mgmt-Console 
        {
            Ensure  = "Present"
            Name    = "Web-Mgmt-Console" 
        }
        WindowsFeature Mgmt-Service 
        {
            Ensure  = "Present"
            Name    = "Web-Mgmt-Service" 
        }

        $secpasswd = ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force
        $cred = New-Object System.Management.Automation.PSCredential ("username", $secpasswd)

        xWebAppPool ApplicationPool
        {
            Name = "my-application-pool"
            AutoStart = $true
            ManagedPipelineMode = "Integrated"
            ManagedRuntimeVersion = "v4.0"
            IdentityType = "SpecificUser"
            Credential = $cred
            Enable32BitAppOnWin64 = $false

        }
    }
}

$ConfigurationData = @{
    AllNodes = @(
        @{
            NodeName = "Webserver"
            PSDscAllowPlainTextPassword = $true
            PSDscAllowDomainUser = $true
        }
    )
}

MyWebsite -ConfigurationData $ConfigurationData

The creation of the application pool depends on a module called xWebAdministration. We expect that this module will be downloaded by the client node during the execution of the MOF file – is this correct? Further, the .zip file for this module is made available on the pull server in the modules directory with its checksum file.

enter image description here

The event log of the pull server doesn’t show any errors. The client node event log is also devoid of error entries. The client successfully sends reports to the pull server.

Do you perhaps have any suggestions as to what we may be missing?

Best Answer

You will require some mechanism to push DSC module as well, May be below article will help you.

vcloud-lab.com/entries/desired-state-configuration/powershell-finding-powershell-dsc-module-and-downloading-it-2