# win\_dsc using PolicyFileEditor DSC Module: failed to convert String to SINT32

**URL:** <https://forum.ansible.com/t/win-dsc-using-policyfileeditor-dsc-module-failed-to-convert-string-to-sint32/24735>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [June 15, 2017, 2:39pm UTC](https://forum.ansible.com/t/win-dsc-using-policyfileeditor-dsc-module-failed-to-convert-string-to-sint32/24735 "2017-06-15T14:39:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo\_Gaspar](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@Ricardo\_Gaspar](https://forum.ansible.com/u/Ricardo_Gaspar)\
**Post date:** [June 15, 2017, 2:39pm UTC](https://forum.ansible.com/t/win-dsc-using-policyfileeditor-dsc-module-failed-to-convert-string-to-sint32/24735/1 "2017-06-15T14:39:24Z")

</div>

Hi all,

I was using the cAdministrativeTemplateSetting DSC Resource part of PolicyFileEditor module ( [https://github.com/dlwyatt/PolicyFileEditor](https://github.com/dlwyatt/PolicyFileEditor)) in a DSC script and it works fine. Here are the resource’s properties:  
`

cAdministrativeTemplateSetting [String] #ResourceName  
{  
KeyValueName = [string]  
PolicyType = [string]{ Administrators | Machine | NonAdministrators | User }  
[Data = [string]]  
[DependsOn = [string]]  
[Ensure = [string]{ Absent | Present }]  
[PsDscRunAsCredential = [PSCredential]]  
[Type = [Int32]{ Binary | DWord | ExpandString | MultiString | None | QWord | String | Unknown }]  
}  
`

It has a property called Type which is a map of strings to integers ([https://github.com/dlwyatt/PolicyFileEditor/blob/master/DscResources/PshOrg\_AdminTemplateSetting/PshOrg\_AdminTemplateSetting.schema.mof](https://github.com/dlwyatt/PolicyFileEditor/blob/master/DscResources/PshOrg_AdminTemplateSetting/PshOrg_AdminTemplateSetting.schema.mof)):

`[write,ValueMap{"0","1","2","3","4","7","11","-1"},Values{"Unknown","String","ExpandString","Binary","DWord","MultiString","QWord","None"}] sint32 Type;`

When using in my DSC script it works fine, I can use **DWord** or **String** as an argument for the **Type** property. Check my Script:

`  
Configuration LocalGPO  
{  
param  
(  
[string] $NodeName = ‘localhost’  
)

Import-DSCResource -ModuleName PolicyFileEditor

Node $NodeName  
{

cAdministrativeTemplateSetting “RDP Users Home Directory Path”  
{

# SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services!WFHomeDirUNC

# SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services!WFHomeDir

# SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services!WFHomeDirDrive

KeyValueName = “SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\WFHomeDir”  
PolicyType = “Machine”  
Data = “\servershare\test”  
Ensure = “Present”  
Type = “String”  
}

cAdministrativeTemplateSetting “RDP Users Home Directory Letter”  
{  
KeyValueName = “SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\WFHomeDirDrive”  
PolicyType = “Machine”  
Data = “X:”  
Ensure = “Present”  
Type = “String”  
}

cAdministrativeTemplateSetting “RDP Users Home Directory UNC boolean”  
{  
KeyValueName = “SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\WFHomeDirUNC”  
PolicyType = “Machine”  
Data = “1”  
Ensure = “Present”  
Type = “Dword”  
}

}

}

LocalGPO  
Start-DscConfiguration -Path .\LocalGPO -Wait -Force -Verbose  
`

My Ansible Script (first attempt):

`

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [June 15, 2017, 11:27pm UTC](https://forum.ansible.com/t/win-dsc-using-policyfileeditor-dsc-module-failed-to-convert-string-to-sint32/24735/2 "2017-06-15T23:27:34Z")

</div>

Hey

Thanks for the info you’ve posted, win\_dsc has only been recently merged. Without knowing too much about how it works it seems like this is a bug with the module and it would be beneficial to raise an Issue at [https://github.com/ansible/ansible](https://github.com/ansible/ansible).

Thanks

Jordan
