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
28
votes
4 answers

PowerShell DSC - how to pass configuration parameters to ScriptResources?

I'm having a lot of trouble trying to get a PowerShell Desired State Configuration script working to configure an in-house application. The root of the problem is that I can't seem to pass my configuration data down into a ScriptResource (at least…
mclayton
  • 8,025
  • 2
  • 21
  • 26
14
votes
2 answers

Chocolaty packages not installing via OneGet/PackageManagement in Windows 10?

I'm trying to use oneget w/chocolaty and it doesn't seem to be working at all. The package says it's installed, no warning or notification. It installs the package in the choco directory, but doesn't run the install script and therefore the…
Ashtonian
  • 4,371
  • 2
  • 18
  • 25
14
votes
2 answers

How do I resolve "Cannot invoke the SendConfigurationApply method." when performing Start-DscConfiguration?

Another way to phrase the question less specifically: What is the correct way to 'reset' the DSC processes on a target machine? I've created a DSC configuration that I'm iterating on right now, and I am adding new Package configuration which I've…
d3r3kk
  • 3,465
  • 3
  • 18
  • 22
11
votes
2 answers

How do you apply multiple DSC configurations?

Here's my example: $Config = @{ AllNodes = @( @{ NodeName = 'localhost'; PSDscAllowPlainTextPassword = $True } ) } Configuration LocalAdmin { Param([String[]]$Node='localhost',[PSCredential]$Cred) Import-DscResource…
Maximilian Burszley
  • 18,243
  • 4
  • 34
  • 63
10
votes
4 answers

How do you automatically distribute Desired State Configuration custom resources as part of a deployment?

I'm working on leveraging Microsoft's DSC Resource Kit (specifically, XWebAdministration, at least for starters). I'm relatively familiar with DSC, so no worries on the script's actual functionality... it does what it's supposed to, or at least I'm…
Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
9
votes
2 answers

App Pool advanced settings using Powershell Desired Configuration State

How can I modify various settings inside either a new or exisitng App Pool using Powershell? I am interesting in some of the "Advanced" settings such as Enable 32-Bit Applications, Managed Pipeline Mode, Process Model Identity, etc. Any ideas on…
halamadrid
  • 103
  • 1
  • 1
  • 4
8
votes
1 answer

Azure DSC Extension: What is "Module-qualified Name of Configuration"

While setting up an Azure DSC Extension for a VM in the Azure Portal (ARM) we find the form below. What goes in the highlighted text-field, what module is it asking me to specify? The xPSDesiredStateConfiguration module? That didn't work and I…
AllTradesJack
  • 2,762
  • 5
  • 25
  • 36
8
votes
2 answers

Powershell DSC: Unable to load module xPSDesiredStateConfiguration

I'm working through the DSC book from powershell.org and trying to setup a pull server using the configuration code specified in the book. configuration CreatePullServer { param ( [string[]]$ComputerName = 'localhost' ) …
NickG
  • 191
  • 1
  • 1
  • 9
8
votes
4 answers

Installing executables with Powershell DSC

I am trying to install Visual Studio 2013 using PowerShell DSC but I'm running into a few issues and hoping that you guys could clear it up for me. Is DSC capable for rebooting the node and then resuming an installation of VS? Does anyone know what…
user3120136
  • 81
  • 1
  • 3
7
votes
2 answers

Configure a DSC Resource to restart

I have a DSC resource that installs dotnet feature and then installs an update to dotnet. In the Local Configuration Manager I have set RebootNodeIfNeeded to $true. After dotnet installs, it does not request a reboot (even used xPendingReboot module…
DamianB
  • 361
  • 2
  • 5
  • 16
7
votes
2 answers

How do I make a PowerShell DSC foreach loop around File resource for copying multiple files defined in the config?

I'm trying to use PowerShell DSC to do multiple file copies. My configuration has a list of source/target files that need to be copied. However, the File resource needs to have a unique name with it so that you can do dependencies on the…
Mark Zuber
  • 69
  • 2
  • 3
7
votes
4 answers

Trouble setting up MSMQ ACL using PowerShell cmdlet

My MSMQ queue gets created by PowerShell DSC engine. I can see queues created. Since DSC engine runs from SYSTEM account, then queue owner also gets set to SYSTEM. When I try to set MSMQ ACL from PowerShell console I constantly get following…
Juris Krumins
  • 91
  • 1
  • 5
7
votes
6 answers

Remove a PowerShell DSC Configuration

Is it possible to remove a DSC configuration from a computer, once it has been applied? For example, I have a configuration block as follows: configuration SevenZip { Script Install7Zip { GetScript = { $7ZipFolder =…
user189198
7
votes
2 answers

Installing an exe with Powershell DSC Package resource gets return code 1619

I'm trying to use Powershell DSC's Package resource to install an exe... Perforce's P4V to be specific. Here's my code: Configuration PerforceMachine { Node "SERVERNAME" { Package P4V { Ensure = "Present" …
Jay Spang
  • 2,013
  • 7
  • 27
  • 32
6
votes
1 answer

Azure RM Templates. How to upload assets automatically with VS instead of fetching them from GitHub

I would like to be able to deploy a complex ARM template that utilizes DSC extensions and nested templates from my local Visual Studio. The example is set to download assets from…
WinBoss
  • 879
  • 1
  • 17
  • 40
1
2 3
33 34