Get-Certificate cmdlet failed

Petr Synek 6 Reputation points
2022-06-14T12:59:02.48+00:00

I need to issue a certificate for a server. I run these commands:
$cred = Get-Credential Get-Certificate -Template Templatename -CertStoreLocation Cert:\LocalMachine\My -Credential $cred
But after the second command I get this error:
Get-Certificate :
At line:1 char:1
+ Get-Certificate -Template Templatename -CertStoreLocation Cert:\LocalMachine\ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-Certificate], ParameterBindingException
+ FullyQualifiedErrorId : RuntimeException,Microsoft.CertificateServices.Commands.GetCertificateCommand
What's this? I mean, there's no description of the error. What's wrong? Is that something in the command syntax, is something wrong with the server, with the network... How do I solve this?

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,565 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,807 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,602 questions
{count} votes

4 answers

Sort by: Most helpful
  1. rr-4098 1,766 Reputation points
    2022-06-15T18:42:55.757+00:00

    Are you getting any error codes like 0x<RandomNumbersandLetters>?


  2. Rich Matheisen 47,501 Reputation points
    2022-06-17T14:43:51.767+00:00

    If you look at the properties of the template "Templatename", do you have permission to "Read" and "Enroll" using the template (either explicitly or through security group membership)?


  3. rr-4098 1,766 Reputation points
    2022-06-19T09:17:49.097+00:00

    What OS is the server running? If possible see if you can upgrade Powershell to 5.1.


  4. rr-4098 1,766 Reputation points
    2022-06-20T14:31:13.693+00:00

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.