Author Posts

July 10, 2018 at 11:29 pm

I've read and tried everything I could find for multiple hours to no success...

I have a Powershell DSC Pull server set up. It is working with out-of-box DSC Resources.

That is, the below code works without error, and is pushed without error to a client computer:

$ConfigurationData = @{
    AllNodes = @(
        @{
            NodeName="*"
            PSDscAllowPlainTextPassword = $true
            PSDscAllowDomainUser = $true
        },
        @{
            NodeName = $ComputerName
        }
    )
}

Configuration SetPullMode {
    param (
        [string]$ComputerName
    )
    Node $ComputerName {
        LocalConfigurationManager {
            AllowModuleOverwrite = $true
            ConfigurationMode = 'ApplyAndAutoCorrect'
            RefreshMode = 'Pull'
            RefreshFrequencyMins = 30
            ConfigurationModeFrequencyMins = 60
            RebootNodeIfNeeded = $true
            DownloadManagerName = 'WebDownloadManager'
            DownloadManagerCustomData = ${
                ServerUrl = 'http://holo-rdm-dsc:8080/PSDSCPullServer.svc';
                AllowUnsecureConnection = 'true'
            }
        }
    }
}

Configuration TestDSCState {
    param (
        [string[]]$ComputerName
    )

    Import-DscResource –ModuleName 'PSDesiredStateConfiguration'

    Node $ComputerName {

        File CreateLogsDirectory {
            DestinationPath = 'C:\logs'
            Ensure = "Present"
            Force = $true
            Type = 'Directory'
        }

        File CreateTestFile {
            DestinationPath = "C:\logs\TestFile.txt"
            Ensure = "Present"
            Force = $true
            Type = 'File'
            Contents = "This `r`n is `r`n TestFileOne"
        }
    }
}

$ComputerName = 'holo-dsc-tst3'

SetPullMode -ComputerName $ComputerName -OutputPath 'C:\Users\v-jodev\Desktop\TestDSCState' -ConfigurationData $ConfigurationData
Set-DscLocalConfigurationManager -ComputerName $ComputerName -Path C:\Users\v-jodev\Desktop\TestDSCState -Verbose

TestDSCState -ComputerName $ComputerName -ConfigurationData $ConfigurationData -OutputPath 'C:\Users\v-jodev\Desktop\TestDSCState'

$Source="C:\Users\v-jodev\Desktop\TestDSCState\$ComputerName.mof"
#$Destination="C:\Program Files\WindowsPowerShell\DscService\Configuration\$GUID.mof"
$Destination="C:\Program Files\WindowsPowerShell\DscService\Configuration\$ComputerName.mof"
Copy $Source $Destination -Verbose -Force
New-DSCChecksum $Destination -Verbose -Force

Start-DscConfiguration -ComputerName $ComputerName -Path "C:\Program Files\WindowsPowerShell\DscService\Configuration" -Wait -Force -Verbose

The output from the above code:

    Directory: C:\Users\v-jodev\Desktop\TestDSCState


Mode                LastWriteTime         Length Name                                                                                                                                                                                                                                                                                     
----                -------------         ------ ----                                                                                                                                                                                                                                                                                     
-a----        7/10/2018   4:06 PM           1510 holo-dsc-tst3.meta.mof                                                                                                                                                                                                                                                                   
VERBOSE: Performing the operation "Start-DscConfiguration: SendMetaConfigurationApply" on target "MSFT_DSCLocalConfigurationManager".
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendMetaConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer HOLO-RDM-DSC with user sid S-1-5-21-2127521184-1604012920-1887927527-22118087.
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Start  Set      ]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Start  Resource ]  [MSFT_DSCMetaConfiguration]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Start  Set      ]  [MSFT_DSCMetaConfiguration]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Set      ]  [MSFT_DSCMetaConfiguration]  in 0.0460 seconds.
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Resource ]  [MSFT_DSCMetaConfiguration]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Set      ]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Set      ]    in  0.1090 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Set-DscLocalConfigurationManager finished in 0.349 seconds.
-a----        7/10/2018   4:06 PM           2850 holo-dsc-tst3.mof                                                                                                                                                                                                                                                                        
VERBOSE: Performing the operation "Copy File" on target "Item: C:\Users\v-jodev\Desktop\TestDSCState\holo-dsc-tst3.mof Destination: C:\Program Files\WindowsPowerShell\DscService\Configuration\holo-dsc-tst3.mof".
VERBOSE: Overwrite checksum file 'C:\Program Files\WindowsPowerShell\DscService\Configuration\holo-dsc-tst3.mof.checksum'
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer HOLO-RDM-DSC with user sid S-1-5-21-2127521184-1604012920-1887927527-22118087.
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Start  Set      ]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Start  Resource ]  [[File]CreateLogsDirectory]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Start  Test     ]  [[File]CreateLogsDirectory]
VERBOSE: [HOLO-DSC-TST3]:                            [[File]CreateLogsDirectory] The destination object was found and no action is required.
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Test     ]  [[File]CreateLogsDirectory]  in 0.0310 seconds.
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Skip   Set      ]  [[File]CreateLogsDirectory]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Resource ]  [[File]CreateLogsDirectory]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Start  Resource ]  [[File]CreateTestFile]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Start  Test     ]  [[File]CreateTestFile]
VERBOSE: [HOLO-DSC-TST3]:                            [[File]CreateTestFile] The destination object was found and no action is required.
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Test     ]  [[File]CreateTestFile]  in 0.0160 seconds.
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ Skip   Set      ]  [[File]CreateTestFile]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Resource ]  [[File]CreateTestFile]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Set      ]
VERBOSE: [HOLO-DSC-TST3]: LCM:  [ End    Set      ]    in  0.5000 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.707 seconds

And the resulting file created on the client computer:

PS C:\> ls .\logs\


    Directory: C:\logs


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        7/10/2018   4:00 PM             28 TestFile.txt


PS C:\> cat .\logs\TestFile.txt
This
 is
 TestFileOne

The issue that I'm having is that adding a module from the Powershell Gallery fails.

I add the appropriate Import-DscResource block:

Import-DscResource -ModuleName ”xRemoteDesktopAdmin” -ModuleVersion "1.1.0.0"

And the code block itself:

    xRemoteDesktopAdmin EnableRemoteDesktop {
        Ensure = "Present"
        UserAuthentication = "Secure"
    }

Except this time, an error occurs:

A generic exception occurred during the invocation of the Get-DSCModule cmdlet by Download Manager WebDownloadManager. Could not install module dependencies needed by the configuration.
    + CategoryInfo          : InvalidType: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : GetModuleExecutionFailure
    + PSComputerName        : holo-dsc-tst3

The error on the client computer itself:

Job {E7BF096A-8496-11E8-B491-00155DBC9F10} : 
MIResult: 1
Error Message: A generic exception occurred during the invocation of the Get-DSCModule cmdlet by Download Manager WebDownloadManager. Could not install module dependencies needed by the configuration.
Message ID: GetModuleExecutionFailure
Error Category: 9
Error Code: 1
Error Type: MI

I've checked a hundred times that the module is present:

PS C:\Windows\system32> Install-Module xRemoteDesktopAdmin
PS C:\Windows\system32> Import-Module xRemoteDesktopAdmin
PS C:\Windows\system32> Get-Module xRemoteDesktopAdmin

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Manifest   1.1.0.0    xRemoteDesktopAdmin


PS C:\Windows\system32> Get-Module xRemoteDesktopAdmin | Publish-ModuleToPullServer
VERBOSE: Preparing to compress...
VERBOSE: Performing the operation "Compress-Archive" on target "
C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\DSCResources
C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\Examples
C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\appveyor.yml
C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\LICENSE
C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\README.md
C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\xRemoteDesktopAdmin.psd1".
VERBOSE: Adding 'C:\Program
Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\DSCResources\xRemoteDesktopAdmin\xRemoteDesktopAdmin.psm1'.
VERBOSE: Adding 'C:\Program
Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\DSCResources\xRemoteDesktopAdmin\xRemoteDesktopAdmin.schema
.mof'.
VERBOSE: Adding 'C:\Program
Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\Examples\ExampleConfiguration-RemoteDesktopAdmin.ps1'.
VERBOSE: Adding 'C:\Program
Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\Examples\ExampleConfiguration-RemoteDesktopAdminWithEncrypt
edPassword.ps1'.
VERBOSE: Adding 'C:\Program
Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\Examples\ExampleConfiguration-RemoteDesktopAdminWithUnEncry
ptedPassword.ps1'.
VERBOSE: Adding 'C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\appveyor.yml'.
VERBOSE: Adding 'C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\LICENSE'.
VERBOSE: Adding 'C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\README.md'.
VERBOSE: Adding 'C:\Program Files\WindowsPowerShell\Modules\xRemoteDesktopAdmin\1.1.0.0\xRemoteDesktopAdmin.psd1'.

And that its correctly named and versioned .zip file and checksum exist:

PS C:\Windows\system32> Get-ChildItem 'C:\Program Files\WindowsPowerShell\DscService\Modules'


    Directory: C:\Program Files\WindowsPowerShell\DscService\Modules


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        7/10/2018   4:04 PM           8232 xRemoteDesktopAdmin_1.1.0.0.zip
-a----        7/10/2018   4:04 PM             64 xRemoteDesktopAdmin_1.1.0.0.zip.checksum

And that its contents are correct

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        7/10/2018   3:44 PM                DSCResources
d-----        7/10/2018   3:44 PM                Examples
-a----        9/11/2015   4:28 PM           2658 appveyor.yml
-a----        9/11/2015   4:28 PM           1108 LICENSE
-a----        9/11/2015   4:28 PM           3113 README.md
-a----        9/11/2015   4:28 PM            907 xRemoteDesktopAdmin.psd1

At this point, I'm stumped beyond stumped. Nothing I've tried, read, or found has worked. Please help!

July 11, 2018 at 1:21 pm

First of all, thank you for such thorough evidence. It makes this a lot easier – and thank you for properly formatting everything!

There're a few random things to check. First, make sure you've unblocked the file – removing the header tags that indicate it came from the Internet.

Make sure xRemoteDesktopAdmin doesn't have any module dependencies itself which aren't present – that can be a snafu a lot of times. So, in a fresh console, list all loaded modules (Get-Module). Then import xRemoteDesktopAdmin and list 'em again, to make sure nothing new has popped up.

On the node attempting this configuration, pop open Event Viewer and find the DSC log. Right-click to enable the debug and diagnostics logs, and see if there's anything more useful in terms of forensics. Ditto on the Pull Server.

Finally, if your pull server isn't using HTTPS, use Wireshark or something to sniff the packets while the node's LCM is attempting a configuration check. It can be useful to see the low-level requests being sent by the node and the pull server's responses ("The DSC Book" has some examples of a proper "run" of every possible request the LCM can make).

July 11, 2018 at 3:35 pm

Thank you for the reply! We're getting somewhere after running through your suggestions 🙂

I checked the module for dependencies as suggested by running Get-Module and Import-Module, and comparing. Doesn't appear to be any that are missing.

I enabled debug and analytic logging, then went through all the configs with a fine-tooth comb. Looks like I made a typo in the Configuration section $ –> @

The debug error in question:

Job {2647BC70-851D-11E8-B492-00155DBC9F10} : 
Message Cannot process command because of one or more missing mandatory parameters: ServerUrl. 
HResult -2146233087 
StackTrack    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DownloadManagerBase.PullOneModule(PowerShell powershell, ModuleSpecification moduleSpecification, String configurationId, String downloadLocation, Hashtable arguments, IEnumerable`1 argumentParameters, String& downloadedModule, Collection`1& pullOneModuleResult, ErrorRecord& errorRecord, UInt32& getActionStatusCode)

Changing the config from:

            DownloadManagerCustomData = ${
                ServerUrl = 'http://holo-rdm-dsc:8080/PSDSCPullServer.svc';
                AllowUnsecureConnection = 'true'

to:

            DownloadManagerCustomData = @{
                ServerUrl = 'http://holo-rdm-dsc:8080/PSDSCPullServer.svc';
                AllowUnsecureConnection = 'true'

Now when I run the config, the server is located, but the module isn't found:

Cannot find module xRemoteDesktopAdmin_1.1.0.0 from the server http://holo-rdm-dsc:8080/PSDSCPullServer.svc/Modules(Mod
uleName='xRemoteDesktopAdmin',ModuleVersion='1.1.0.0')/ModuleContent. Could not install module dependencies needed by
the configuration.
    + CategoryInfo          : ResourceUnavailable: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : WebDownloadManagerModuleNotFound,Microsoft.PowerShell.DesiredStateConfiguration.Commands
   .GetDscModuleCommand
    + PSComputerName        : holo-dsc-tst3

The logs from the client state the same:

Job {16C44035-851E-11E8-B492-00155DBC9F10} : 
MIResult: 1
Error Message: Cannot find module xRemoteDesktopAdmin_1.1.0.0 from the server http://holo-rdm-dsc:8080/PSDSCPullServer.svc/Modules(ModuleName='xRemoteDesktopAdmin',ModuleVersion='1.1.0.0')/ModuleContent. Could not install module dependencies needed by the configuration.
Message ID: WebDownloadManagerModuleNotFound,Microsoft.PowerShell.DesiredStateConfiguration.Commands.GetDscModuleCommand
Error Category: 21
Error Code: 1
Error Type: MI

As do the IIS logs from the server:

The location of the configuration file whose config path is 'MACHINE/WEBROOT/APPHOST/PSDSCPULLSERVER/PSDSCPullServer.svc/Modules(ModuleName='xRemoteDesktopAdmin',ModuleVersion='1.1.0.0')/ModuleContent' was mapped to '\\?\C:\inetpub\wwwroot\PSDSCPullServer\PSDSCPullServer.svc\Modules(ModuleName='xRemoteDesktopAdmin',ModuleVersion='1.1.0.0')\ModuleContent'.

The pull server was set up with the correct log path originally:

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"
            UseSecurityBestPractices = $false
            DependsOn = "[WindowsFeature]DSCServiceFeature"
        }

        xDscWebService PSDSCComplicanceServer {
            Ensure = "Present"
            EndpointName = "PSDSCComplianceServer"
            Port = 9080
            PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCComplianceServer"
            CertificateThumbPrint = "AllowUnencryptedTraffic"
            State = "Started"
            UseSecurityBestPractices = $false
            DependsOn = ("[WindowsFeature]DSCServiceFeature","[xDSCWebService]PSDSCPullServer")
        }
    }
}

And the key paths in the web.config file for the server are set correctly:

   
    
    
    
    
    
    
    
    
  
     

Am I reading the logs right that the Pull Server is mapping the paths incorrectly? It is mapping the module path to the PhysicalPath

PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer"

and not to ModulePath

ModulePath = "$env:ProgramFiles\WindowsPowerShell\DscService\Modules"

July 11, 2018 at 3:43 pm

Hmm, tried to edit the code blocks because I caught an error, and now I'm getting:

ERROR: Duplicate reply detected; it looks as though you've already said that!

Looks like my reply is being held for moderation or something due to anti-spam filters. Hopefully it will go through shortly.

Thank you for the reply! We're getting somewhere after running through your suggestions 🙂

I checked the module for dependencies as suggested by running Get-Module and Import-Module, and comparing. Doesn't appear to be any that are missing.

I enabled debug and analytic logging, then went through all the configs with a fine-tooth comb. Looks like I made a typo in the Configuration section $ –> @

The debug error in question:

Job {2647BC70-851D-11E8-B492-00155DBC9F10} : 
Message Cannot process command because of one or more missing mandatory parameters: ServerUrl. 
HResult -2146233087 
StackTrack    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DownloadManagerBase.PullOneModule(PowerShell powershell, ModuleSpecification moduleSpecification, String configurationId, String downloadLocation, Hashtable arguments, IEnumerable`1 argumentParameters, String& downloadedModule, Collection`1& pullOneModuleResult, ErrorRecord& errorRecord, UInt32& getActionStatusCode)

Changing the config from:

            DownloadManagerCustomData = ${
                ServerUrl = 'http://holo-rdm-dsc:8080/PSDSCPullServer.svc';
                AllowUnsecureConnection = 'true'

to:

            DownloadManagerCustomData = @{
                ServerUrl = 'http://holo-rdm-dsc:8080/PSDSCPullServer.svc';
                AllowUnsecureConnection = 'true'

Now when I run the config, the server is located, but the module isn't found:

Cannot find module xRemoteDesktopAdmin_1.1.0.0 from the server http://holo-rdm-dsc:8080/PSDSCPullServer.svc/Modules(Mod
uleName='xRemoteDesktopAdmin',ModuleVersion='1.1.0.0')/ModuleContent. Could not install module dependencies needed by
the configuration.
    + CategoryInfo          : ResourceUnavailable: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : WebDownloadManagerModuleNotFound,Microsoft.PowerShell.DesiredStateConfiguration.Commands
   .GetDscModuleCommand
    + PSComputerName        : holo-dsc-tst3

The logs from the client state the same:

Job {16C44035-851E-11E8-B492-00155DBC9F10} : 
MIResult: 1
Error Message: Cannot find module xRemoteDesktopAdmin_1.1.0.0 from the server http://holo-rdm-dsc:8080/PSDSCPullServer.svc/Modules(ModuleName='xRemoteDesktopAdmin',ModuleVersion='1.1.0.0')/ModuleContent. Could not install module dependencies needed by the configuration.
Message ID: WebDownloadManagerModuleNotFound,Microsoft.PowerShell.DesiredStateConfiguration.Commands.GetDscModuleCommand
Error Category: 21
Error Code: 1
Error Type: MI

As do the IIS logs from the server:

The location of the configuration file whose config path is 'MACHINE/WEBROOT/APPHOST/PSDSCPULLSERVER/PSDSCPullServer.svc/Modules(ModuleName='xRemoteDesktopAdmin',ModuleVersion='1.1.0.0')/ModuleContent' was mapped to '\\?\C:\inetpub\wwwroot\PSDSCPullServer\PSDSCPullServer.svc\Modules(ModuleName='xRemoteDesktopAdmin',ModuleVersion='1.1.0.0')\ModuleContent'.

The pull server was set up with the correct log path originally:

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"
            UseSecurityBestPractices = $false
            DependsOn = "[WindowsFeature]DSCServiceFeature"
        }

        xDscWebService PSDSCComplicanceServer {
            Ensure = "Present"
            EndpointName = "PSDSCComplianceServer"
            Port = 9080
            PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCComplianceServer"
            CertificateThumbPrint = "AllowUnencryptedTraffic"
            State = "Started"
            UseSecurityBestPractices = $false
            DependsOn = ("[WindowsFeature]DSCServiceFeature","[xDSCWebService]PSDSCPullServer")
        }
    }
}

And the key paths in the web.config file for the server are set correctly:

   
    
    
    
    
    
    
    
    
  
     

Am I reading the logs right that the Pull Server is mapping the paths incorrectly? It is mapping the module path to the PhysicalPath

PhysicalPath = "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer"

and not to ModulePath

ModulePath = "$env:ProgramFiles\WindowsPowerShell\DscService\Modules"

July 11, 2018 at 3:47 pm

Sorry for the duplicate post above–once I figure out how to delete one of them, I will.

Web.config code from above not showing, repeated here:

    
    
    
    
    
    
    
    

July 11, 2018 at 3:47 pm

You can't post XML or HTML in there forums. Those will need to be posted as a Gist, and you can include the Gist URL here.

Based on what you've posted, just reading through, it feels as if it should work. That means there's something minor gumming up the works, which is the hardest to fix remotely. I'd start checking stuff like file permissions, for example.

In terms of the folder mapping, that's an easy enough thing to troubleshoot, right? Drop a copy of the module where you think the server is (erroneously) looking for it, and see if that fixes the problem.

July 12, 2018 at 5:06 pm

Holy cow... so I finally got it working...

I don't know what the original problem was. I ended up wiping the server and client systems, reimaging, and starting fresh. Went through and applied each step as before (seemingly, obviously something was different since it didn't work last time), and all is working now! 🙂

Thanks for the help Don!