In these days, I tried to use ansible to manage windows server.
But met trouble after I generate a certificate:
https://docs.ansible.com/ansible/latest/user_guide/windows_winrm.html#generate-a-certificate

After mapping the certificate by command:

$username = "username"
$password = ConvertTo-SecureString -String "password" -AsPlainText -Force
$credential = New-Object -TypeName System.Management.Automation.PSCredential 
-ArgumentList $username, $password

# this is the issuer thumbprint which in the case of a self generated cert
# is the public key thumbprint, additional logic may be required for other
# scenarios
$thumbprint = (Get-ChildItem -Path cert:\LocalMachine\root | Where-Object { 
$_.Subject -eq "CN=$username" }).Thumbprint

New-Item -Path WSMan:\localhost\ClientCertificate `
    -Subject "$username@localhost" `
    -URI * `
    -Issuer $thumbprint `
    -Credential $credential `
    -Force

I found the password was wrong, so I wanna delete this mapping. However, I 
cannot find a way to delete it.
How can I deal with it?

-- 
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/9eb6fa7a-d26e-4107-a5a4-c670690d6d0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to