# password errors importing windows ssl certificate

**URL:** <https://forum.ansible.com/t/password-errors-importing-windows-ssl-certificate/37448>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [December 9, 2022, 6:58pm UTC](https://forum.ansible.com/t/password-errors-importing-windows-ssl-certificate/37448 "2022-12-09T18:58:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Veliss](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@John\_Veliss](https://forum.ansible.com/u/John_Veliss)\
**Post date:** [December 9, 2022, 6:58pm UTC](https://forum.ansible.com/t/password-errors-importing-windows-ssl-certificate/37448/1 "2022-12-09T18:58:19Z")

</div>

I am trying to import a certificate using both

1. win\_certificate\_store

- name: Import certificate be used by IIS  
win\_certificate\_store:  
path: c:\temp\SDCW.abc.com.pfx  
password: test01  
state: present  
file\_type: pkcs12  
store\_location: LocalMachine  
store\_name: My  
key\_storage: machine  
key\_exportable: yes  
become: yes  
become\_method: runas  
become\_user: SYSTEM

1. win\_shell + Import-PfxCertificate

- name: Import certificate to be used by IIS, using win\_shell (powershell)  
win\_shell: |  
$securePassword = “test01”  
$mypwd = ConvertTo-SecureString -String $securePassword -Force -AsPlainText  
$certFilePath = “c:\temp\SDCW.abc.com.pfx”  
Import-PfxCertificate -FilePath $certFilePath -CertStoreLocation cert:\LocalMachine\My -Exportable -Password $mypwd

Both ways always give me errors relating to password

The specified network password is not correct

I am able to run the above PS script locally on my local computer and import the cert successfully, so I know the password is correct.

If anyone has any ideas, it would be appreciated.

Thanks
