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!