It works, thanks Jordan
在 2018年9月21日星期五 UTC+8上午11:54:21,Gary Mo写道:
>
> 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/ccd7c1ea-4a8e-47fb-9ef6-2b4cd24e39b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to