This works from the ansible task server using powershell:
$password = "xxx" | ConvertTo-SecureString -asPlainText -Force
$username = "xx\xxxxx"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Invoke-Command -ComputerName DC01 -credential $Credential -ScriptBlock { repadmin /syncall /AdeP }
How can I use the above to be able to use it using the ansible.windows.win_shell module, in ansible?
Thanks