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
4
votes
1 answer

DSC, compiling a ps1 file into MOF

I'm trying to configure a target node via DSC. I've created a .ps1 file with a dummy Configuration; you can see it below; it's just one of the first examples that you find in DSC sites. Now I want to compile it into .mof file. I've executed: PS…
CSG
  • 247
  • 5
  • 14
4
votes
2 answers

Create DSC Configuration dynamically

TLDR; What is the best way to create a DSC configuration file dynamically? I am tasked with maintaining a complex folder structure including permissions. This is currently done with custom PowerShell modules. The problems arise when changes are made…
4
votes
5 answers

DSC Push mode - best way to copy DSC resources

I'm exploring DSC and wondering what's the best way to copy DSC resources to target host ? When I try to push my configuration to the target host, It complain of missing DSC resource. The PowerShell DSC resource xWebAdministration does not exist at…
Philip K. Adetiloye
  • 3,102
  • 4
  • 37
  • 63
4
votes
2 answers

Define WebApp slots in Resource Manager Template

I'm having trouble finding information/guides on adding slots to WebApps programmatically, using Resource Manager templates. I've got my base configuration working well, creating the WebApp itself, SQL server, SQL DB etc., but I'm keen to get the…
James
  • 1,028
  • 9
  • 20
4
votes
1 answer

PowerShell Desired State Configuration -WhatIf

Is it possible to run a DSC configuration and get the WhatIf output from Set-TargetResource? I've written a custom resource, and the Set function has all the necessary code for WhatIf/ShouldProcess to work (and indeed, if you call Set-TargetResource…
Jack
  • 115
  • 7
4
votes
2 answers

DSC ConfigurationData parameter in Azure ARM template deployment

I am deploying a resource group by using the Azure REST API and supplying the ARM templates. In the virtual machine resource, I have an extension that is of type DSC. The code snippet is as follows: { "resources": [ { "name":…
4
votes
1 answer

How to install visual studio 2013 by powershell dsc

I want to install visual studio 2013 through powershell dsc on (hyper v) virtual machine but i could not find any proper link to install it via powershell dsc, as i am new in this field and i don't have any experience, can you help me regarding…
hussain
  • 57
  • 3
3
votes
0 answers

Ansible win_dsc fails to install SqlServer with SqlServerDsc

I am trying to install SQLServer 2019 on Windows Server 2019 using ansible and SqlServerDsc I am getting am error about missing CimClass MSFT_SqlSetup. It seems that I am missing something to be installed or ? The full traceback is: Not found At…
Zied MAKTOUF
  • 61
  • 2
  • 5
3
votes
2 answers

Passing Credentials using DSC and ARM Template and Deploying with Visual Studio 2017

I am taking my first crack at making a DSC (Desired State Configuration) file to go with an ARM (Azure Resource Manager) template to deploy a Windows Server 2016 and so far everything was working great until I tried to pass a username/password so I…
NightOwl888
  • 55,572
  • 24
  • 139
  • 212
3
votes
2 answers

Puppet-hiera-Function lookup() did not find a value-Windows

I installed dsc module and added AD user to Domain controller using puppet. Code below works fine when hard-coding password as plain text. Is it possible somehow to encrypt those passwords. I read that hiera-eyaml is solution for this so i…
user10205566
3
votes
1 answer

In a powershell DSC resource declaration, what syntactical element is the declaration?

I'm trying to figure out what syntactical element is in use for a Powershell DSC resource declaration. For example: SqlServerNetwork "RDBMS" { DependsOn = @("[SqlSetup]RDBMS") InstanceName = "MSSQLSERVER" …
Peter McEvoy
  • 2,816
  • 19
  • 24
3
votes
0 answers

Get-DSCConfiguration indicates consistency check or pull cmdlet is in progress for many days

I am not able to understand what exactly is happening under the cover but whenever I run get-dscconfiguration reports consistency check is in progress. I want to know what is happening for it to be in a wait state for many days?? PS…
learner
  • 2,480
  • 10
  • 50
  • 94
3
votes
0 answers

DSC Https Pull Server - An error occurred while sending the request

I've been struggling two weeks with the DSC Pull Server configuration. I had no success configuring an http/https pull server neither with ConfigurationId approach nor using ConfigurationNames Smb Pull server was the only server configuration that…
3
votes
1 answer

Using Ansible to execute Powershell DSC

My end goal is to configure AdcsCertificationAuthority on a Server 2016 Server using Ansible. - name: Install ADCS with sub features and management tools win_feature: name: Adcs-Cert-Authority state: present include_management_tools:…
Justin Seiser
  • 359
  • 1
  • 3
  • 13
3
votes
2 answers

Is there a DSC Resource for .NET version installed?

Working on some DSC configurations and some of the applications that I am installing require a specific version of .NET to be installed as a prerequisite. I was wondering if there was a DSC Resource for .NET version installed on the system?
Jim
  • 692
  • 7
  • 15
1 2
3
33 34