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
2 answers

How to get available parameters that we can pass for a chocolatey package or in cchoco dsc resource

I want to know about how can we get to know what parameters we can pass during a package installation using chocolatey like can we pass username,password and port during postgres installation from chocolatey repository.
Narinder Verma
  • 153
  • 2
  • 16
3
votes
1 answer

Desired State Configuration Vs Azure ARM - Are They Complimentary to Each Other?

Have been well versed with ARM Templates & Parameters using Powershell. I have come to know lately that Desired State Configuration is the recommended way by Microsoft for Windows Server configurations. As some of many of the parameters can also be…
Abhijeet
  • 13,562
  • 26
  • 94
  • 175
3
votes
1 answer

Initialize variable amount of disks with a single DSC configuration

Is it possible to initialize all attached disks to multiple VMs with a single DSC configuration? For example if VM1 has 1 disk attached that DSC configuration would initialize that disk as disk F, VM2 has 2 disks, so the very same DSC configuration…
Max
  • 35
  • 11
3
votes
2 answers

Managing Multiple servers in an environment with Powershell DSC

I want to manage the servers in our staging pipeline with Powershell DSC (push model). The servers map to the environments as following Development: 1 server Test: 2 servers UAT: 2 servers Production: 2 servers The server(s) within one environment…
3
votes
2 answers

PowerShell DSC. Download and install software

Is it possible to download some software from internet, then install it on some of my servers using DSC? Chrome, for example? All DSC tutorials are pretty hard to understand (at least for me). I just want to see a simple example, similar to my use…
Brozaf
  • 136
  • 1
  • 8
3
votes
1 answer

How do I obtain the current Windows DSC working folder (ie. "\DSC.0")?

Anyone know how to obtain the current DSC working folder? On the server, when DSC runs, it generates a folder stucture like the following: C:\Packages\Plugins\Microsoft.Powershell.DSC\2.18.0.0\DSCWork\DSC.0 The only trouble is when DSC gets a new…
webbexpert
  • 704
  • 9
  • 15
3
votes
2 answers

Why does the OpenSSL installation hang using Chocolatey/PowerShell DSC?

I am trying to install OpenSSL from Chocolatey using following Powershell DSC script: cChocoInstaller installChoco { InstallDir = "c:\choco" } cChocoPackageInstaller installOpenSSL { Name = "openssl.light" DependsOn =…
coder_andy
  • 376
  • 1
  • 3
  • 17
3
votes
1 answer

DSC Configuration Keeps Restarting

I have my LocalConfigurationManager set up as follows: [DSCLocalConfigurationManager()] Configuration LCMConfig { Node localhost { Settings { RebootNodeIfNeeded = $true ActionAfterReboot =…
Jeff
  • 35,755
  • 15
  • 108
  • 220
3
votes
1 answer

DSC Package resource have identical key properties

I'm trying to first uninstall a package, then install the latest version of that same package. Simple you would think, but when I include the following code in my DSC configuration: ### remove old product setup Package removeOldProduct { …
Samer
  • 3,848
  • 4
  • 25
  • 24
3
votes
2 answers

Encryption certificates must contain Data Encipherment or Key Encipherment

After upgrading to Windows Management Framework 5.0, I have started to receive the following exception when sourcing a DSC configuration. ConvertTo-MOFInstance : System.ArgumentException error processing property 'Password' OF TYPE…
Cobster
  • 1,243
  • 10
  • 18
3
votes
3 answers

DSC: How to stop and start a windows service

I want to do a very simple thing with DSC (Desired State Configuration): Stop a windows service, deploy files and finally start the service again. Thus I had the following: Service ServicesStop { Name = "TheTestService" State =…
timtos
  • 2,225
  • 2
  • 27
  • 39
3
votes
0 answers

Powershell DSC Script Resource Fails on Successful Execution Installing Apache

I'm trying to install Apache 2.4 on Windows 2012 using Powershell 4.0/Desired State Configuration. Since Apache apparently does not update the WMI database I don't think I can use the Package Resource because it will never match on Name or Product…
Arluin
  • 594
  • 1
  • 8
  • 21
3
votes
1 answer

Azure DSC, cannot load module xPSDesiredStateConfiguration

I'm trying to write a DSC configuration for an Azure VM that I am creating using Resource Manager. I want to use xRemoteFile, so I try to import the xPSDesiredStateConfiguration module, but when I deploy it is not found. I searched the web, and…
3
votes
1 answer

DSC: Module file *ModuleName* did not contain a module with required version 1.0

I am trying out the new Desired state configuration stuff and trying to work with a new class resource. I have installed the pre-production preview of WMF 5.0 on all servers involved in the process. I have a Http pull server setup where I have…
Alexis Coles
  • 1,227
  • 14
  • 19
3
votes
1 answer

DSC File Resource - copy file

I'm using a PowerShell DSC Pull Server. It's possible to use the File resource to copy a file every time is modified? I've tried the below: File Test{ DestinationPath = "c:\yyy\test.txt" SourcePath = "\\share\test.txt" …
ds19
  • 3,176
  • 15
  • 33