# DSC not accepting values from config file

**URL:** https://forums.powershell.org/t/dsc-not-accepting-values-from-config-file/11456
**Category:** DSC
**Created:** [October 11, 2018, 5:21am UTC](https://forums.powershell.org/t/dsc-not-accepting-values-from-config-file/11456 "2018-10-11T05:21:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)
#### Post date: [October 11, 2018, 5:21am UTC](https://forums.powershell.org/t/dsc-not-accepting-values-from-config-file/11456/1 "2018-10-11T05:21:09Z")

</div>

Hi Everyone,

I have a weird issue with my configuration. I am trying to create RDS environment across 3 servers. My issue is that DSC not accepting value from configuration data. In my configuration data I have both PSDscAllowPlainTextPassword, PSDscAllowDomainUser fields but still I get this issue.

```
$data = @{
  AllNodes = @(
    @{
        NodeName = '*'
        PSDscAllowPlainTextPassword = $true
        PSDscAllowDomainUser = $true
    },

    @{....
```

Even If I have both **PSDscAllowPlainTextPassword, PSDscAllowDomainUser** it is not accepting it.

ConvertTo-MOFInstance : System.InvalidOperationException error processing property ‘PsDscRunAsCredential’ OF TYPE ‘xRDSessionDeployment’: Converting and storing encrypted passwords as plain text is not recommended. For m  
ore information on securing credentials in MOF file, please refer to MSDN blog: [Securing the MOF File - PowerShell | Microsoft Docs](https://go.microsoft.com/fwlink/?LinkId=393729)  
At C:\RDS2016.ps1:109 char:9  
WARNING: It is not recommended to use domain credential for node ‘System.Collections.Hashtable’. In order to suppress the warning, you can add a property named ‘PSDscAllowDomainUser’ with a value of $true to your DSC conf  
iguration data for node ‘System.Collections.Hashtable’.

---

<div class="post-metadata">

### Author: ![kvprasoon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kvprasoon/32/4449_2.png) [@kvprasoon](https://forums.powershell.org/u/kvprasoon)
#### Post date: [October 11, 2018, 5:55am UTC](https://forums.powershell.org/t/dsc-not-accepting-values-from-config-file/11456/2 "2018-10-11T05:55:20Z")

</div>

How are you calling pushing the configuration ? Can you show us the code which is triggering the configuration.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)
#### Post date: [October 11, 2018, 6:05am UTC](https://forums.powershell.org/t/dsc-not-accepting-values-from-config-file/11456/3 "2018-10-11T06:05:37Z")

</div>

Hi,

Here comes the whole config

```
$data = @{
  AllNodes = @(

    @{
        NodeName = '*'
        PSDscAllowPlainTextPassword = $true
        PSDscAllowDomainUser = $true      
     },

    @{
        NodeName = 'rdcb01'
        Role = 'Connection Broker'
    },

    @{        
        NodeName = 'rdsh01'
        Role = 'Session Host'
    },

    @{
        NodeName = 'rdwa01'
        Role = 'Web Access'
    }

  );

  RDSData = @{
        ConnectionBroker = 'rdcb01.domain.com'
        SessionHost = 'rdsh01.domain.com'
        WebAccessServer = 'rdwa01.domain.com'
        CollectionName = 'RDS'
        AutomaticReconnectionEnabled = $true
        DisconnectedSessionLimitMin = 300
        IdleSessionLimitMin = 300
        BrokenConnectionAction = 'Disconnect'
        UserGroup = 'Domain Users'
    
   }

}

Configuration RDS {

param ( 
    
     [Parameter(Mandatory=$true)]
     [pscredential]$DomainAdminCred
)

#region

Import-DscResource -ModuleName PSDesiredStateConfiguration, 
    @{ModuleName='xRemoteDesktopSessionHost';ModuleVersion="1.8.0.0"}

#endregion

Node $AllNodes.Where{$_.Role -eq 'Connection Broker'} {
$RDData = $data.RDSData
        WindowsFeature RDSConnectionBroker {
        Name = 'RDS-Connection-Broker'
        Ensure = 'Present'
        }

        WindowsFeature RSATRDSTools {
        Name = 'RSAT-RDS-Tools'
        Ensure = 'Present'
        IncludeAllSubFeature = $true
        DependsOn = '[WindowsFeature]RDSConnectionBroker'
        }
        
        WaitForAll SessionHost {
        NodeName = 'rdsh01'
        ResourceName = '[WindowsFeature]SessionHost'
        RetryIntervalSec = 15
        RetryCount = 50
        DependsOn = '[WindowsFeature]RSATRDSTools'
        }

        WaitForAll WebAccess {
        NodeName = 'rdwa01'
        ResourceName = '[WindowsFeature]WebAccess'
        RetryIntervalSec = 15
        RetryCount = 50
        DependsOn = '[WaitForAll]SessionHost'
        }

        xRDSessionDeployment NewDeployment {
        ConnectionBroker = $RDData.ConnectionBroker
        SessionHost = $RDData.SessionHost
        WebAccessServer = $RDData.WebAccessServer
        DependsOn = '[WaitForAll]WebAccess'
        PsDscRunAsCredential = $DomainAdminCred
        }

        xRDSessionCollection collection {    
        CollectionName = $RDData.CollectionName
        SessionHost = $RDData.SessionHost
        ConnectionBroker = $RDData.ConnectionBroker
        DependsOn = '[xRDSessionDeployment]NewDeployment'
        PsDscRunAsCredential = $DomainAdminCred
        }
} 

Node $AllNodes.Where{$_.Role -eq 'Session Host'}.NodeName {
        WindowsFeature SessionHost {
        Name = 'RDS-RD-Server'
        Ensure = 'Present'
        }
}

Node $AllNodes.Where{$_.Role -eq 'Web Access'}.NodeName {
        WindowsFeature WebAccess {
        Name = 'RDS-Web-Access'
        Ensure = 'Present'
        }
    }
}

RDS -OutputPath 'C:\' -DomainAdminCred $DomainAdminCred -ConfigurationData $data -Verbose
```

---

<div class="post-metadata">

### Author: ![kvprasoon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kvprasoon/32/4449_2.png) [@kvprasoon](https://forums.powershell.org/u/kvprasoon)
#### Post date: [October 11, 2018, 11:52pm UTC](https://forums.powershell.org/t/dsc-not-accepting-values-from-config-file/11456/4 "2018-10-11T23:52:06Z")

</div>

You have missed to take out NodeName from Node $AllNodes.Where{$\_.Role -eq ‘Connection Broker’}

it should be Node

```
$AllNodes.Where{$_.Role -eq 'Connection Broker'}.NodeName
```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)
#### Post date: [October 12, 2018, 7:56am UTC](https://forums.powershell.org/t/dsc-not-accepting-values-from-config-file/11456/5 "2018-10-12T07:56:29Z")

</div>

Thank you so much. Don’t understand how could I miss that but it is wierd that DSC didn’t prompt for that.

---

<div class="post-metadata">

### Author: ![kvprasoon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/kvprasoon/32/4449_2.png) [@kvprasoon](https://forums.powershell.org/u/kvprasoon)
#### Post date: [October 12, 2018, 8:06am UTC](https://forums.powershell.org/t/dsc-not-accepting-values-from-config-file/11456/6 "2018-10-12T08:06:56Z")

</div>

DSC won’t prompt for that, the condition **$AllNodes.Where{$\_.Role -eq ‘Connection Broker’}** does have an output which is a hashtable, it then converts it to a string and will get **System.Collections.Hashtable** as value and will treat that as a node name. your mof file will get created with this name if you try to execute by commenting the credential part.

```
-a---- 10/12/2018 7:03 PM 4378 System.Collections.Hashtable.mof
```

---

<div class="post-metadata">

### Author: ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)
#### Post date: [May 16, 2024, 9:16pm UTC](https://forums.powershell.org/t/dsc-not-accepting-values-from-config-file/11456/7 "2024-05-16T21:16:24Z")

</div>


