Questions tagged [dsc]

Desired State Configuration (DSC) is a feature in Windows Powershell that enables deployment and management of configuration data for software services and management of the environment in which these services run.

Description

DSC is a management platform in Windows PowerShell that enables deploying and managing configuration data for software services and managing the environment in which these services run.

DSC provides a set of Windows PowerShell language extensions, new Windows PowerShell cmdlets, and resources that you can use to declaratively specify how you want your software environment to be configured. It also provides a means to maintain and manage existing configurations.

Practical Applications

Following are some example scenarios where you can use built-in DSC resources to configure and manage a set of computers (also known as target nodes) in an automated way: Enabling or disabling server roles and features

  • Enabling or disabling server roles and features

  • Managing registry settings

  • Managing files and directories

  • Starting, stopping, and managing processes and services

  • Managing groups and user accounts

  • Deploying new software

  • Managing environment variables

  • Running Windows PowerShell scripts

  • Fixing a configuration that has drifted away from the desired state

  • Discovering the actual configuration state on a given node

In addition, you can create custom resources to configure the state of any application or system setting.

* Source: http://technet.microsoft.com/en-us/library/dn249912.aspx

Azure DSC

DSC has become a core configuration technology in Azure, Microsoft's cloud platform. A DSC can be associated with an Azure VM when it is created by setting a DSC configuration provision parameter. This ensures once the VM comes to a ready state, the vm is in the configuration required by the application.

There are three mechanisms by which Azure invokes DSC:

  • On VM creation if a DSC extension is set with Set-AzureVMDSCExtension cmdlet

  • On VM reboot: DSC is re-run during every VM reboot to assure the VM is in the "Desired State"

  • On VM update: if Set-AzureVMDSCExtension is executed on an existing VM, it will execute DSC.

Source: https://msdn.microsoft.com/en-us/library/azure/dn877980.aspx?f=255&MSPPError=-2147217396

AWS (Amazon Web Services) DSC

DSC has been extended to AWS, Amazon's cloud platform. A DSC can can be executed when an AWS VM is created with CloudFormation. This ensures once the VM comes to a ready state, the vm is in the configuration required by the application.

Source: https://s3.amazonaws.com/quickstart-reference/microsoft/powershelldsc/latest/doc/Windows_PowerShell_DSC_on_AWS.pdf

AWS DSC Toolkit

This module allows you to register AWS EC2 instances as DSC Nodes in Azure Automation. You can then control your EC2 instances in Azure Automation using PowerShell DSC configurations.

Source: https://github.com/PowerShell/AwsDscToolkit

Source: https://blogs.msdn.microsoft.com/powershell/2016/04/20/aws-dsc-toolkit/

510 questions
3
votes
1 answer

Why does this use of DSC File Resource using shared folder only succeed once?

I am testing the use of the DSC File resource for copying a directory of files from a shared folder to another machine. My problem is that this works once but running the same code a second time fails. If I restart the target machine the script will…
nuxibyte
  • 1,434
  • 1
  • 13
  • 16
3
votes
2 answers

Running Start-DscConfiguration gives "the network connection to computername has been interrupted"

I'm running the following cmd locally on the server: Start-DscConfiguration -computername mycomputer -Path C:\install -Wait -Verbose The output is: WARNING: [WSManNetworkFailureDetected] The network connection to computername has been…
iprotocol
  • 147
  • 1
  • 11
3
votes
1 answer

PowerShell DSC Pull and Push Mode Together

I am using PowerShell 4.0 and configured a DSC Pull Server. Few clients are connected to the Pull Server and those are getting configurations properly. Below is the LCM details in a client machine: However, there are some times we would like to…
skjcyber
  • 5,759
  • 12
  • 40
  • 60
3
votes
2 answers

Start-DscConfiguration cannot connect the server machine

I am trying to run my DSC configuration against a remote machine and end up with the following error VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' =…
Vish
  • 827
  • 11
  • 21
3
votes
3 answers

PowerShell: How to install the DSC Resource Kit Wave 8 modules?

I am trying to set up a DSC pull server on Windows 2012 R2 machine by following this technet article: http://technet.microsoft.com/en-us/library/dn249913.aspx However I just can't get the modules working. The installation instructions says: To…
Matthias Güntert
  • 4,013
  • 6
  • 41
  • 89
3
votes
1 answer

Why can I not configure TFS Build Service in unattend mode via Powershell DSC?

With the following DSC configuration (snippet of the resources section only, cut out preamble, diagnostics, and Start-DscConfiguration parts for SO): Package TFSServer2013 { Name = "Microsoft Team Foundation Server 2013 Update 3…
d3r3kk
  • 3,465
  • 3
  • 18
  • 22
3
votes
1 answer

Where's the Analytics / UI to PowerShell DSC?

Even using pull mode for Powershell DSC, it doesn't seem there's an easy way to visualise which machines are in which states and which machines are in the process of correcting themselves to the desired state (i.e. still installing stuff /…
Squirrel
  • 1,189
  • 12
  • 15
3
votes
1 answer

How do I conditionally execute a resource in Powershell DSC based on a previous resource executing?

Say I've got two blocks like this: Configuration TestConfig { Node ('localhost') { File foo { DestinationPath = 'C:\foo.txt' Contents = 'Bar' } Script dothing { SetScript = {'Baz' |…
3
votes
2 answers

Duplicate Command line argument

I get an error saying that I have a duplicate command line argument... anyone know why this would be happening and what would be the work-around? $fileServer = 'server.contoso.local' $MediaPath =…
user1475623
3
votes
2 answers

PowerShell DSC - Node processing is skipped since the node name is empty

I'm stuck with a problem applying filters to Nodes in a DSC Configuration block when zero computer nodes match the filter criteria. For example: configuration MyApp { node $AllNodes.Where{ $_.Role -Match "role1|role2" }.NodeName { File…
mclayton
  • 8,025
  • 2
  • 21
  • 26
2
votes
3 answers

The password supplied to the Desired State Configuration resource is not valid. The password cannot be null or empty

I have been dealing with this error for the past day, where any Powershell DSC resource that uses a PowerShell credential object fails with the following error: The password supplied to the Desired State Configuration resource is not valid. The…
Juan M. Elosegui
  • 6,471
  • 5
  • 35
  • 48
2
votes
0 answers

DSC cannot create SSL/TLS secure channel in the SendConfigurationApply function

I am trying to add a vm scale set to an agent pool in Azure Devops. I have set up the VMSS and now am adding DSC as an extension which will then call "SendConfigurationApply" to send to the agent pool. However when I upgrade the VMs I get this…
2
votes
1 answer

How to make the proxy settings of a windows VM by using desired state configuration (DSC) in Azure?

I am checking how to make the proxy settings of a windows VM by using desired state configuration (DSC) in Azure. Is there a library of DSC? Normally, i am using below commands to set the proxy from the cli: Set-ItemProperty -Path…
MoonHorse
  • 1,966
  • 2
  • 24
  • 46
2
votes
2 answers

Powershell to install desired dotnetframework version

My client doesn't have Puppet or Chef or Choco, and I can't install them on his server to install my App. Check installed versions of dotnet framework. Convert to '.' split string Convert to System.Version (some have 2 split or 3 split…
OzBob
  • 4,227
  • 1
  • 39
  • 48
2
votes
1 answer

Why is my powershell DSC failing with the message "An item with the same key has already been added"

We have a powershell DSC that is being executed to bring a vmss to a desired state. It was working until we added some more parameters, and then it broke. I removed everything except the parameters from the script and it still doesn't work. The…
Austin_G
  • 177
  • 11