523 questions
0
votes
0
answers
51
views
DSC v3 for Linux And Integration with Azure
hope this post finds you well!
I'm trying to figure out how to implement DSC for Ubuntu and RedHat machines on Azure. From the looks into the documentation of DSC v3. From the looks of it, DSC v3 is ...
0
votes
1
answer
188
views
winget configure configuration.dsc.yaml - to set windows group membership
I have the following configuration.dsc.yaml file:
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
assertions:
- resource: Microsoft.Windows.Developer/...
0
votes
0
answers
37
views
PowerShell DSC, what happens when I remove settings in the .mof file?
I have a DSC config that I wrote which sets three registry keys. I noticed that when I compile this DSC, it generates a .mof file which has three settings blocks in it, like so:
instance of ...
0
votes
0
answers
88
views
How to Stop or Cancel a Running Windows DSC Operation That Never Returns?
I'm working with Windows Desired State Configuration (DSC) using Ansible's win_dsc module. However, I encountered an issue where a DSC operation initiated by Ansible hangs indefinitely, causing the ...
0
votes
0
answers
57
views
How to Sign a JSON Using USB DSC Hardware
I am working on a project where I need to sign a JSON object using a Digital Signature Certificate (DSC) stored on a USB token.
I understand that the private key is not directly extractable from the ...
0
votes
0
answers
27
views
Is it possible to reference one Desired State Configuration file within another?
I am in the process of setting up a repository, and I would like to use Desired State Configuration to help others setup their development environment. I would like to create a .dsc.yaml file for a ...
0
votes
1
answer
340
views
I need to get the ResourceGroup and ResourceID of the Associated Azure VM of my DSC node
I have two nodes registered in resourcegroup1 when I run Get-AzAutomationDSCNode.
Both nodes have the same name "Node1" but belong to different resource groups.
Node1 - resourcegroup1
Node1 -...
-1
votes
1
answer
197
views
Convert Azure desired state configs (DSC) powershell scripts to JSON or YAML
Convert Azure desired state configs (DSC) PowerShell scripts to JSON or YAML
Is there a way to do convert DSC .ps files to json or yaml.
I am trying to covert DSC first to python but that is also not ...
0
votes
0
answers
27
views
The command dsc (Azure BridgeToKubernetes) is failing when running on Git Bash or Windows CMD but working on WSL in isolation mode
The command dsc (BridgeToKubernetes) is failing when running on Git Bash or Windows CMD but working on WSL in isolation mode and working in non-isolation mode. I am connecting to the remote cluster ...
1
vote
2
answers
113
views
PowerShell DSC Conditional Statement issues
Working with PowerShell DSC and having an issue with conditional statements inside the Configuration file. The code is below. I get the following error:
VERBOSE: [AT20BLDTESTDB01]: LCM: [ Start ...
1
vote
1
answer
205
views
Azure: How to use custom module in State Configuration
I created a class based DSC Resource as a Powershell Module and successfully uploaded it to
Azure Automation/Modules. It has a green icon and seems to be added successfully. Now I want to use this ...
0
votes
0
answers
376
views
Winget Configuration error when using xPSDesiredStateConfiguration DSC module
So I have a winget config file, here is everything but the problem block omitted:
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
resources:
- resource: ...
0
votes
0
answers
128
views
Get-DscConfigurationStatus Invalid namespace
I'm trying to execute some scripts that utilizes DSC and it seems to be failing pretty hard.
From all the documentation I've found, I believe I'm following the right steps and installing it, but ...
0
votes
1
answer
137
views
Azure SecurityPolicyDSc error - 'the array index evaluated to null'
I am trying to apply various custom Policies to Windows VMs on Azure. Most are unproblematic, however when trying to use the module SecurityPolicyDSC, specifically the AccountPolicy resource, I get ...
0
votes
0
answers
68
views
How do I provide configuration name dynamically during DSC compilation?
I have configuration named sqlconfig defined in file called sqlconfig.ps1 which I want to compile while passing DSC data structure and name of configuration itself to it. Sample code is below
$sqlData ...
0
votes
1
answer
37
views
Is it possible to have common configuration in DSC configuration block?
I'm wondering if it's possible in configuration block which contains 2 nodes to have also configuration which will be common between 2 nodes without duplicating code (some sort of include ...
0
votes
1
answer
119
views
How do I create accounts in AD Users container using DSC?
I've got a section in my DSC-configuration that creates new accounts in a specified OU.
(Input parameters are omitted in the example below.)
Please ignore that I'm currently handling passwords with -...
0
votes
0
answers
76
views
Schedule Task created using DSC, not able assign USERS group for running the task
TaskName = 'EXCEL-Auto'
TaskPath = '\CustomTasks'
ActionExecutable = 'C:\Program Files\Microsoft
Office\root\VFS\...
0
votes
0
answers
1k
views
DSC Certificate Update - Method C_GenerateKeyPair returned CKR_General_error with Error Code [5]
I am trying to Update
My DSC is Expiring Soon But geting Error
now Following the Same steps given in Video but Getting Error After Login
https://www.youtube.com/watch?v=CQGz2RzwX-U
trying to update ...
1
vote
1
answer
160
views
Azure DSC extention. How to use additional items in a archive
I'm trying to use DSC extension for Azure VM. I have created zip archive with main PS file, and included additional archive to the main archive, with couple additional files
After DSC extension is ...
0
votes
1
answer
148
views
Read file content and output result by Desired State Configuration
I use DSC, and try to read txt file and get it output to the console, and frankly - futile.
I have tried to use Script resource, but neither GetScript no SetScript helped to me.
Maybe do you guys know ...
0
votes
1
answer
313
views
While deploying the DSC configuration getting error: "The PowerShell DSC resource X from module Y does not exist at the PowerShell module"
While deploying the DSC configuration I am getting below error:
InvalidOperation: The PowerShell DSC resource MSFT_AADGroupsNamingPolicy from module <Microsoft365DSC,1.23.726.1> does not exist ...
0
votes
0
answers
372
views
How do I resolve scheduled task created using DSC can't be started manually?
I've tried setting up a scheduled task using DSC (Desired State Configuration) that starts at "creation time" and restarts if it's stopped within 5 minutes using the configuration below...
1....
0
votes
1
answer
537
views
Applying HSTS settings using WebAdministrationDsc/WebConfigPropertyCollection?
I'm using Windows Server 2019, Posh5.1, WebAdministrationDsc 4.1.0, and WebConfigPropertyCollection. I see I have to use 2 passes for the resource to do this way for multiple properties, so I ...
0
votes
0
answers
57
views
Azure AutomationAccount DSC scripts debug
I am running a DSC script from an Azure automation account to configure Windows VMs. It downloads files from a storage account in Azure to hosts for more configurations. If I hardcode the storage ...
0
votes
0
answers
453
views
Passing secure parameter to PowerShell DSC script from Bicep template
I am using a Bicep template to deploy a virtual machine with a PowerShell DSC script that adds a Log Analytics workspace to the Log Analytics agent. The script uses a secure parameter (workspaceKey1) ...
1
vote
1
answer
268
views
How do I update an array in an array in a hashtable in Powershell?
I'm using Powershell desired state configuration and have a separate definition document (psd1) I load into memory via
$ConfigData = Import-PowerShellDataFile "$Path"
where I'd like to ...
1
vote
0
answers
88
views
Why is the installationpolicy of the PSGallery does not change even when Puppet states it changed?
I am generally new to Puppet, so would need a bit of a help with the following problem:
I am trying to use this module: https://forge.puppet.com/modules/dsc/powershellget
Added this to the manifest:
...
0
votes
1
answer
169
views
PowerShell Desired State Configuration - Conditionally Create resources
What I am trying to do is the following. Our server host 4 different web applications through an IIS Website ( maybe more in the future ) . Depending on the customer they may have 1 or more of those ...
1
vote
1
answer
244
views
Merge multiple configuration files using powershell
My Powershell script receives multiple Microsoft Office365 DSC policy configuration policy files as input in a folder as below:
file1.ps1
Configuration EXOSharingPolicy {
param (
[...
0
votes
1
answer
205
views
DSC to create multiple apppools
I am trying to create multiple app pools using DSC. If I try to make the $AppPoolName accept an array I get the error:
Exception calling "ValidateInstanceText" with "1" argument(s):...
0
votes
3
answers
877
views
DSC Configuration 'AD' completed with error(s). Following are the first few: WinRM cannot process the request
I am getting below error while triggering a dsc configuration in a AD VM.
VMExtensionProvisioningError","message":"VM has reported a failure when processing extension '...
0
votes
1
answer
273
views
Desired State Configuration File Resource Fails
I am trying to use desired state configuration to check whether or not a file exists in a specific location on the virtual machine that the configuration is applied to. The code compiles but when I ...
2
votes
3
answers
747
views
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 ...
0
votes
1
answer
151
views
Azure AVD post configuration automation
I work for a little to medium size client with an azure eco system and try to find a good way
to make configuration to AVD after there creation.
I know there are tools like ansible but for the little ...
0
votes
1
answer
96
views
PowerShell DSC Exclude property from drift test
I'm using the xWebAdministration module to create IIS sites and application pools. When creating the site, a physical path needs to be specified. This path is changed with each deployment of the site ...
0
votes
1
answer
194
views
Expand variable in PowerShell DSC File resource content property
I have $Node.NodeName, $Node.Environment, $Node.Role defined in the following DSC config file. They don't appear to expand to the correct values in the MOF file and instead shows:
HOSTNAME: System....
0
votes
0
answers
80
views
Powershell DSC - MSFT_RoleResource
I have a problem related to MSFT_RoleResource, I have recovered a DSC script that you can find below:
The compilation in .mof works as shown below:
Once the compilation is finished I want to make an ...
0
votes
1
answer
466
views
AzureRM Automation DSC Configuration
I'm trying to configure Azure DSC Configuration, but I am running into two issues.
I continue to get this error message
Error = 'invalid character 'c' looking for beginning of value' JSON = '...
1
vote
0
answers
69
views
Why won't my DSC configuration let me pass a [ref], and what's an alternative?
I'm trying to pass a variable to my DSC configuration, and have it modified inside it, then returned. To do so, I wanted to use a ref var.
Like so in my powershell script:
configuration My_DSC_config
{...
0
votes
1
answer
184
views
Dynamically adding SQL Logins to DSC for Azure Automation Credentials
I have a SQL Server on a VM being setup using a DSC file. I have been able to use SQL Login in the past (https://github.com/dsccommunity/SqlServerDsc/wiki/SqlLogin) but that only allows me to use it ...
0
votes
1
answer
176
views
DSC Extension for linux. Error in the dsc.py
Could u please help?
During the DSC Installation for Linux I'm receiving the following issues:
OS: Linux (ubuntu 20.04)
I'm using the following script for extension provisioning:
$vmname = 'ds'
$...
1
vote
0
answers
144
views
How do I use a required module in a custom DSC Resource when using PsDscRunAsCredential
I have created a custom PowerShell DSC resource that relies on a separate module being present on the node. I have the module on all nodes for all users (C:\Program Files\WindowsPowerShell\Modules). ...
1
vote
1
answer
423
views
Is there a way to reference a parameter value within the same PSD1 file?
Let's say that I have a PSD1 file, with the following code:
@{
AllNodes = @(
@{
NodeName = $env:COMPUTERNAME
Tags = @{
Environment = "dev"
...
0
votes
1
answer
2k
views
PowerShell DSC, Server 2019, .NET 3.5 failing to install from source
I am trying to use DSC to install .NET 3.5 from source, as my server is not able to reach out directly to MSFT. But it is failing with error code 0x800f0954. Here is the code:
WindowsFeature NET_3_5 {
...
0
votes
1
answer
79
views
xSCOM 1.3.3.0 throws an Exception when running DSC on Azure VM
All,
I am trying to automate infrastructure where I am using Azure DevOps CI / CD Pipeline for deploying VM and using DSC to configure / install SCOM using Module XSCOM 1.3.3.0. As per my colleague, ...
0
votes
2
answers
274
views
Delete directory content using Azure Automation DSC
I am using Azure Automation DSC to deploy some basic configurations on my Azure VMs. However, I am struggling to delete recursively all the content of C:/Temp directory and leave the directory as an ...
1
vote
1
answer
450
views
Could not find the module 'cChocoInstaller' when I try to compile my DSC configuration
I'm trying to get Chocolatey installed to manage packages on a a windows VM using Powershell DSC.
I've prepared my configuration file
Configuration chocandfirefox {
Import-DscResource -ModuleName ...
0
votes
2
answers
476
views
DSC add user in local group
In DSC configuration i shoud add local user in group, but before that how i can check if user exists or not, and only after that add in group
User User {
Ensure = "Present" # ...
0
votes
1
answer
369
views
Running DSC in against azure windows vm using terraform
I simply want to run a configuration file or a powershell script against a windows vm using terraform. I dont have a windows box. I dont want to use an automation account or use azure blob storage or ...