Hey

Windows unfortunately doesn't have the concept of sudo like unix so to be 
able to run a process as another user you need to set the password as well 
as the username. Going by the error message you need to set 
'ansible_become_password' to the password of the account you are wanting to 
run as. I haven't played around with runas unfortunately so I can't give 
you any more info.

Another option if you really want to go the route is using the 'HKEY_USERS' 
key. The entry for 'HKEY_CURRENT_USER' in 'HKEY_USERS' is located in this 
key under the SID (S-*-*-*-*-*). So using the 'user' account as an example 
I can use this command to get the SID of the Administrator account

$AdObj = New-Object System.Security.Principal.NTAccount('user')
$strSID = $AdObj.Translate([System.Security.Principal.SecurityIdentifier])
$strSID.Value

It will return the value

S-1-5-21-2607664055-1112657780-300677247-500

So the 'HKEY_CURRENT_USER' when running as 'user' can also be accessed at 
'HKEY_USERS\S-1-5-21-2607664055-1112657780-300677247-500'.

Hope this helps in some way.

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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6a97e76e-4bad-4044-b75a-ef142683ca4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to