I am still having issues with this. I totally rebuilt the server from MS ISO image (w2012r2) and installed/am using xPSDesiredStateConfiguration module version 3.10.0.0. I have installed wmf5 and fully patched the server. I took the Sample_xDSCWebService to create the pull server with minor changes (setting CertificateThumbPrint = “AllowUnencryptedTraffic”):
# DSC configuration for Pull Server
# Prerequisite: Certificate "CN=PSDSCPullServerCert" in "CERT:\LocalMachine\MY\" store for SSL
# Prerequisite: $RegistrationKey value generated using ([guid]::NewGuid()).Guid
# Note: A Certificate may be generated using MakeCert.exe: http://msdn.microsoft.com/en-us/library/windows/desktop/aa386968%28v=vs.85%29.aspx
configuration LabDscWebService
{
param
(
[string[]]$NodeName = 'localhost',
[Parameter(HelpMessage='Use AllowUnencryptedTraffic for setting up a non SSL based endpoint (Recommended only for test purpose)')]
[ValidateNotNullOrEmpty()]
[string] $certificateThumbPrint,
[Parameter(HelpMessage='This should be a string with enough entropy (randomness) to protect the registration of clients to the pull server. We will use new GUID by default.')]
[ValidateNotNullOrEmpty()]
[string] $RegistrationKey = ([guid]::NewGuid()).Guid
)
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Import-DSCResource -ModuleName PSDesiredStateConfiguration
Node $NodeName
{
WindowsFeature DSCServiceFeature
{
Ensure = "Present"
Name = "DSC-Service"
}
xDscWebService PSDSCPullServer
{
Ensure = "Present"
EndpointName = "PSDSCPullServer"
Port = 8080
PhysicalPath = "$env:SystemDrive\inetpub\PSDSCPullServer"
CertificateThumbPrint = "AllowUnencryptedTraffic"
ModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"
ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"
State = "Started"
DependsOn = "[WindowsFeature]DSCServiceFeature"
}
File RegistrationKeyFile
{
Ensure ='Present'
Type = 'File'
DestinationPath = "$env:ProgramFiles\WindowsPowerShell\DscService\RegistrationKeys.txt"
Contents = $RegistrationKey
}
}
}
#This line actually calls the function above to create the MOF file.
LabDscWebService –NodeName "lab-dsc-01.lab2.mckinsey.com"
Start-DSCConfiguration .\LabDscWebService -Wait -verbose
Upon runnning I keep getting the following errors:
VERBOSE: [LAB-DSC-01]: LCM: [ Start Resource ] [[xDSCWebService]PSDSCPullServer]
VERBOSE: [LAB-DSC-01]: LCM: [ Start Test ] [[xDSCWebService]PSDSCPullServer]
VERBOSE: [LAB-DSC-01]: [[xDSCWebService]PSDSCPullServer] Check Ensure
VERBOSE: [LAB-DSC-01]: [[xDSCWebService]PSDSCPullServer] The Website PSDSCPullServer is not present
VERBOSE: [LAB-DSC-01]: LCM: [ End Test ] [[xDSCWebService]PSDSCPullServer] in 18.8750 seconds.
VERBOSE: [LAB-DSC-01]: LCM: [ Start Set ] [[xDSCWebService]PSDSCPullServer]
VERBOSE: [LAB-DSC-01]: [[xDSCWebService]PSDSCPullServer] Create the IIS endpoint
VERBOSE: [LAB-DSC-01]: [[xDSCWebService]PSDSCPullServer] Setting up endpoint at - http://LAB-DSC-01:8080/PSDSCPullServer.svc
VERBOSE: [LAB-DSC-01]: [[xDSCWebService]PSDSCPullServer] Checking IIS requirements
VERBOSE: [LAB-DSC-01]: [[xDSCWebService]PSDSCPullServer] Delete the App Pool if it exists
VERBOSE: [LAB-DSC-01]: [[xDSCWebService]PSDSCPullServer] Remove the site if it already exists
The expression after ‘&’ in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object.
+ CategoryInfo : InvalidOperation: (
, CimException
+ FullyQualifiedErrorId : BadExpression
+ PSComputerName : lab-dsc-01.lab2.mckinsey.com
The expression after ‘&’ in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object.
+ CategoryInfo : InvalidOperation: (
, CimException
+ FullyQualifiedErrorId : BadExpression
+ PSComputerName : lab-dsc-01.lab2.mckinsey.com
The expression after ‘&’ in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object.
+ CategoryInfo : InvalidOperation: (
, CimException
+ FullyQualifiedErrorId : BadExpression
+ PSComputerName : lab-dsc-01.lab2.mckinsey.com
VERBOSE: [LAB-DSC-01]: LCM: [ End Set ] [[xDSCWebService]PSDSCPullServer] in 6.3250 seconds.
The PowerShell DSC resource ‘[xDSCWebService]PSDSCPullServer’ with SourceInfo ‘C:\Temp\Set-DSCPullServer.ps1::34::10::xDscWebService’ threw one or more non-terminating
errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel
for more details.
+ CategoryInfo : InvalidOperation: (
, CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : lab-dsc-01.lab2.mckinsey.com
VERBOSE: [LAB-DSC-01]: LCM: [ Start Resource ] [[File]RegistrationKeyFile]
VERBOSE: [LAB-DSC-01]: LCM: [ Start Test ] [[File]RegistrationKeyFile]
VERBOSE: [LAB-DSC-01]: [[File]RegistrationKeyFile] The system cannot find the file specified.
VERBOSE: [LAB-DSC-01]: [[File]RegistrationKeyFile] The related file/directory is: C:\Program Files\WindowsPowerShell\DscService\RegistrationKey
s.txt.
VERBOSE: [LAB-DSC-01]: LCM: [ End Test ] [[File]RegistrationKeyFile] in 0.2190 seconds.
VERBOSE: [LAB-DSC-01]: LCM: [ Start Set ] [[File]RegistrationKeyFile]
VERBOSE: [LAB-DSC-01]: [[File]RegistrationKeyFile] The system cannot find the file specified.
VERBOSE: [LAB-DSC-01]: [[File]RegistrationKeyFile] The related file/directory is: C:\Program Files\WindowsPowerShell\DscService\RegistrationKey
s.txt.
VERBOSE: [LAB-DSC-01]: LCM: [ End Set ] [[File]RegistrationKeyFile] in 0.0150 seconds.
VERBOSE: [LAB-DSC-01]: LCM: [ End Resource ] [[File]RegistrationKeyFile]
VERBOSE: [LAB-DSC-01]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/…gurationManager:String) , CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : lab-dsc-01.lab2.mckinsey.com
VERBOSE: Operation ‘Invoke CimMethod’ complete.
VERBOSE: Time taken for configuration job to complete is 416.598 seconds
The DSC operational event log shows the same errors as specified above and nothing else. Prior to the rebuild when I was getting the same error the debug logs also did not give any further information other than the generic error:
The expression after ‘&’ in a pipeline element produced an object that was not valid. It must result in a command name, a script block, or a CommandInfo object.
+ CategoryInfo : InvalidOperation: (
, CimException
+ FullyQualifiedErrorId : BadExpression
+ PSComputerName : lab-dsc-01.lab2.mckinsey.com
Please help I am lost right now.