Module Version: 1.3.0
Puppet Version: 4.9
OS Name/Version: Windows Server 2012 R2
Using cAdministrativeTemplateSetting DSC Resource from PolicyFileEditor Module (https://github.com/dlwyatt/PolicyFileEditor) with puppet, there's a problem when one specifyies a value for the Type property (allowed values are: "Unknown","String","ExpandString","Binary","DWord","MultiString","QWord","None") the following error is throwned:
Error: Failed to apply catalog: Parameter dsc_type failed on Dsc_cadministrativetemplatesetting[test-dsc_cAdministrativeTemplateSetting dword]: Invalid value DWord. Should be a signed Integer at /mnt/puppetnfsdir/environments/rchavesg_dsc/hostgroups/hg_windows_dev/manifests/dsc_tests.pp:42
The Type property is an Integer. I can be found in the cAdministrativeTemplateSetting resource MOF file definition (https://github.com/dlwyatt/PolicyFileEditor/blob/master/DscResources/PshOrg_AdminTemplateSetting/PshOrg_AdminTemplateSetting.schema.mof):
] sint32 Type;}}
If instead of specifying a string as a value for the *dsc_type *property an integer is specified, the following error is thrown:
Error: Failed to apply catalog: Parameter dsc_type failed on Dsc_cadministrativetemplatesetting[test-dsc_cAdministrativeTemplateSetting dword]: Invalid value '1'. Valid values are Unknown, String, ExpandString, Binary, DWord, MultiString, QWord, None at /mnt/puppetnfsdir/environments/rchavesg_dsc/hostgroups/hg_windows_dev/manifests/dsc_tests.pp:42
First, create a DSC script that works and compare it with the Puppet manifest.
1. Install the PolicyFileEditor in PowerShell of the target machine:
2. Run a simple DSC Script on the target Windows machine to prove that the resource works fine:
3. On the target machine, run the command gpupdate to update the Group Policy. Then Check the registry keys in HKLM:SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services . There should be a DWORD key with the name WFHomeDirUNC and value 1 .
Using a Puppet manifest
Note: The lines of the errors documented above do not correspond exactly to the lines in this example puppet manifest (in this example there's no line 42. But it corresponds to the last uncommented line of the last resource dsc_type => 'DWord' ). The commented lines are there to show the other values i tested without any success.
Same behavior as a DSC script. I created one to test and compare it.
When using Puppet with DSC, errors are thrown when passing any kind of value to dsc_type property (as it shown in the examples).
The same issue was already submitted by me in the PowerShell github page: