Looking at the code, it seems like the Password option is actually of the 
type PSCredential and not just a SecureString 
https://github.com/PowerShell/xActiveDirectory/blob/dev/DSCResources/MSFT_xADUser/MSFT_xADUser.psm1#L101.
 
This means that you need to setup the Password like you any other 
PSCredential field by setting Password_username and Password_password. The 
module win_dsc scans each property for the expected type and tries to cast 
the input value from Ansible to what it expects but in the case of a 
PSCredential we need to know both the username and password to create it. 
You can see this in the warning message when it says it failed to convert 
Password (System.String) to a PSCredential.

I'm not sure why a Password field is expecting the full credential so maybe 
you can set 'Password_username' as an empty string or set it to the same 
value as 'UserName'. This is more a question for the actual module itself 
as we have no control over this.

On a side note, we do have the win_domain_user module 
https://docs.ansible.com/ansible/latest/modules/win_domain_user_module.html 
and from a glance it should give you what you need without relying on the 
DSC resource.

Thanks

Jordan

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3428c592-89a1-4dcb-a38b-6b5552b1d707%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to