Set-AdfsSslCertificate localhost Access denied

dragan-vucanovic 96 Reputation points

I renew SSL certificate for ADFS and need to update configuration

Set-AdfsSslCertificate -Thumbprint XXXXc4f8b2d239bXXXXXXXXXXXXXX

And getting:

PS0317: One or more of AD FS servers returned errors during execution of command 'Set-AdfsSslCertificate'. Error information: PS0316: AD FS Server:
'localhost', Error: 'Connecting to remote server localhost failed with the following error message : Access is denied. For more information, see the
about_Remote_Troubleshooting Help topic.'.

Enter-PSSession for localhost only works afters -credentials are supplied

Enter-PSSession localhost -Credential $(Get-Credential)

Invoke-Command -ComputerName localhost -Credential $(Get-Credential) -ScriptBlock {Set-AdfsSslCertificate -Thumbprint XXXXc4f8b2d239b7dbeXXXXXXXXXXXXXXX}

also fails with same message

winrm get winrm/config/listener?Address=*+Transport=HTTP
Listener [Source="GPO"]
Address = *
Transport = HTTP
Port = 5985
Enabled = true
URLPrefix = wsman
ListeningOn =,, ::1, fe80::5cb5:74ea:9e1d:1b0c%14

Active Directory Federation Services
Active Directory Federation Services
An Active Directory technology that provides single-sign-on functionality by securely sharing digital identity and entitlement rights across security and enterprise boundaries.
1,188 questions
Windows Server Management
Windows Server Management
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Management: The act or process of organizing, handling, directing or controlling something.
420 questions
0 comments No comments
{count} votes

Accepted answer
  1. dragan-vucanovic 96 Reputation points

    Solved it by running Powershell with BuiltIn administrator account

1 additional answer

Sort by: Most helpful
  1. Peter Puga 11 Reputation points

    Solved it by removing account from Protected Users group.

    2 people found this answer helpful.