# PowerShell Remoting / Certificate Auth / Changing Passwords

**URL:** <https://forums.powershell.org/t/powershell-remoting-certificate-auth-changing-passwords/3251>\
**Category:** PowerShell Help\
**Created:** [October 15, 2014, 2:07am UTC](https://forums.powershell.org/t/powershell-remoting-certificate-auth-changing-passwords/3251 "2014-10-15T02:07:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aftab-hussain](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@aftab-hussain](https://forums.powershell.org/u/aftab-hussain)\
**Post date:** [October 15, 2014, 2:07am UTC](https://forums.powershell.org/t/powershell-remoting-certificate-auth-changing-passwords/3251/1 "2014-10-15T02:07:10Z")

</div>

I’ve setup an image with PowerShell remoting enabled over https and using certificate auth, any machines deployed with this image will be in a workgroup. I assumed certificate auth would work similar in concept to ssh keys, so that a certificate would be bound to the user account regardless of the password. What I’ve found is that if I change the password after configuring certificate auth, I can no longer connect. The only way to fix this is the delete the wsman config for the client certificate and re-issue the command to bind the client cert with the new password.

Is there anyway around this?

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [October 15, 2014, 2:19am UTC](https://forums.powershell.org/t/powershell-remoting-certificate-auth-changing-passwords/3251/2 "2014-10-15T02:19:03Z")

</div>

You need to give some more detail on what you’re using the certificate for.

Is this an SSL certificate being used to secure the WS-MAN endpoint?

Or is the certificate being used to authenticate an incoming user, instead of relying on a password?

I suspect you’re referring to the latter. If that’s the case, I’m not aware of a workaround. The certificate store isn’t set up in a way that facilitates distributing certificates via a master image, in the way you seem to be describing.

---

<div class="post-metadata">

**Author:** ![aftab-hussain](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@aftab-hussain](https://forums.powershell.org/u/aftab-hussain)\
**Post date:** [October 15, 2014, 5:42am UTC](https://forums.powershell.org/t/powershell-remoting-certificate-auth-changing-passwords/3251/3 "2014-10-15T05:42:58Z")

</div>

Yes that’s correct, its the latter. The problem isn’t related to the image being a master, I originally saw the error after my final sysprep. I then tested without a sysprep, so assume a standard machine with powershell configured over https. Client auth certificate works fine, but as soon as I change the password on the administrator’s account, the one I used to bind the certificate, remote powershell stops working. Running the following lines fixes the issue, until the password is changed again:

$Username = ‘Administrator’  
$adminPass = ConvertTo-SecureString ‘Mynewpassword1’ -AsPlainText -Force  
$Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $Username, $adminPass  
del wsman:\localhost\ClientCertificate\ClientCertificate\_\* -recurse  
New-Item -Path WSMan:\localhost\ClientCertificate -Credential $Credentials -Subject admin@localhost -URI \* -Issuer 415E12063261DCEF7724C98FF972C0ABABAB1212 -Force

Note: The ‘del wsman’ is from memory so may be a little off in the target path.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:47pm UTC](https://forums.powershell.org/t/powershell-remoting-certificate-auth-changing-passwords/3251/4 "2024-05-16T20:47:23Z")

</div>


