Welcome › Forums › DSC (Desired State Configuration) › Registration of the Dsc Agent with the server failed
- This topic has 1 reply, 2 voices, and was last updated 2 weeks, 4 days ago by
Participant.
-
AuthorPosts
-
-
December 23, 2020 at 5:06 pm #282137
Hello,
Setting up the DSC pull server and the node for the first time and I am hitting an error that I couldn’t solve. Please help.
Server configuration
Server in Azure
PowerShell123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051configuration Sample_xDscWebServiceRegistration{param([string[]]$NodeName = 'localhost',[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 # A guid that clients use to initiate conversation with pull server)Import-DSCResource -ModuleName PSDesiredStateConfigurationImport-DSCResource -ModuleName xPSDesiredStateConfigurationNode $NodeName{WindowsFeature DSCServiceFeature{Ensure = "Present"Name = "DSC-Service"}xDscWebService PSDSCPullServer{Ensure = "Present"EndpointName = "PSDSCPullServer"Port = 443PhysicalPath = "$env:SystemDrive\inetpub\PSDSCPullServer"CertificateThumbPrint = $certificateThumbPrintModulePath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Modules"ConfigurationPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService\Configuration"State = "Started"DependsOn = "[WindowsFeature]DSCServiceFeature"RegistrationKeyPath = "$env:PROGRAMFILES\WindowsPowerShell\DscService"AcceptSelfSignedCertificates = $trueUseSecurityBestPractices = $trueEnable32BitAppOnWin64 = $false}File RegistrationKeyFile{Ensure = 'Present'Type = 'File'DestinationPath = "$env:ProgramFiles\WindowsPowerShell\DscService\RegistrationKeys.txt"Contents = $RegistrationKey}}}PS C:\Program Files\WindowsPowerShell\DscService\Configuration> Get-DscConfigurationStatus
Status StartDate Type Mode RebootRequested NumberOfResources
—— ——— —- —- ————— —————–
Success 12/23/2020 9:05:38 PM Consistency PUSH False 3Also created the testconfig.mof and the corresponding .checksum under the DSCService\Configurations folder
Client configuration
Test client machine – local desktop
Created the metamof using this configuration
PowerShell12345678910111213141516171819202122[DSCLocalConfigurationManager()]configuration PullClientConfigNames{Node localhost{Settings{RefreshMode = 'Pull'RefreshFrequencyMins = 30ConfigurationMode = 'ApplyAndAutoCorrect'RebootNodeIfNeeded = $true}ConfigurationRepositoryWeb dsc-test{ServerURL = 'https://dsc-test.preprod.com/PSDSCPullServer.svc/'AllowUnsecureConnection = $trueRegistrationKey = 'fc2a988a-aacf-4c6e-a388-fdd0c42338a8'ConfigurationNames = @('testconfig')}}}PullClientConfigNamesWhen running the command
Set-DscLocalConfigurationManager -Path .\PullClientConfigNames -Verbose
Getting the below error message
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 desktop-HOME with user sid S-1-5-21-1893490152-1803344854-317642803-1002.
VERBOSE: [desktop-HOME]: LCM: [ Start Set ]
VERBOSE: [desktop-HOME]: LCM: [ Start Resource ] [MSFT_DSCMetaConfiguration]
VERBOSE: [desktop-HOME]: LCM: [ Start Set ] [MSFT_DSCMetaConfiguration]
VERBOSE: [desktop-HOME]: LCM: [ End Set ] [MSFT_DSCMetaConfiguration] in 0.0340 seconds.
VERBOSE: [desktop-HOME]: LCM: [ End Resource ] [MSFT_DSCMetaConfiguration]
VERBOSE: [desktop-HOME]: LCM: [ End Set ]
Registration of the Dsc Agent with the server https://dsc-test.preprod.com/PSDSCPullServer.svc/ failed. The underlying error is: The PowerShell DSC resource is not a valid Desired State Configuration resource. .
+ CategoryInfo : InvalidOperation: (root/Microsoft/…gurationManager:String) [], CimException
+ FullyQualifiedErrorId : Pull_Registration_ManagedPluginFailure
+ PSComputerName : localhostVERBOSE: Operation ‘Invoke CimMethod’ complete.
VERBOSE: Set-DscLocalConfigurationManager finished in 0.399 seconds.Note: I have the root cert from the pull server copied to the trusted certs on my desktop.
-
December 31, 2020 at 4:11 am #283387
-
-
AuthorPosts
- You must be logged in to reply to this topic.