Chirag Chheda
Chirag Chheda

Reputation: 41

Unable to execute DSC file i n Windows server 2012 R2 from remote machine

When I execute the command to machine I get the following error -

PS C:\Windows\system32> $cimsession = New-CimSession -Credential (Get-Credential -UserName "test" -Message "test") -ComputerName test.cloudapp.net -Port 58718 -SessionOption $cimsessionoption

PS C:\Windows\system32> Get-DscConfiguration -CimSession $cimsession

Get-DscConfiguration : Current configuration does not exist. Execute Start-DscConfiguration command with -Path parameter to specify a 
configuration file and create a current configuration first.
At line:1 char:1
+ Get-DscConfiguration -CimSession $cimsession
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_DSCLocalConfigurationManager:root/Microsoft/...gurationManager) [Get-DscConfiguration],  
   CimException
    + FullyQualifiedErrorId : MI RESULT 1,Get-DscConfiguration
    + PSComputerName        : powerlabdns.cloudapp.net

What does this mean?

Upvotes: 1

Views: 1854

Answers (1)

briantist
briantist

Reputation: 47792

You are not executing a DSC file, you are requesting the current DSC configuration which does not exist (as the error says).

You need to run Start-DscConfiguration first, again as the error says to. You must pass a -Path to that call which is a directory (relative to the target node) where an MOF file (the compiled configuration) resides.

Once you do that, you'll be able to call Get-DscConfiguration to see the current config.

Upvotes: 3

Related Questions