Request certificate, not sure about powershell paramterers RRS feed

  • Question

  • Hello 

    I want to request a certificate from a server using powershell.

    The environment is a hyper-v client and a hyper-v server.

    I can request the certificate fine from mmc, but from powershell I get an error. I have found some examples of this and it looks easy enough but I guess I am missing something. On the client if I go to dc.winlabnet.net in a browser I see the iis start page, so it should be the right url?

    I try to request the certificate using powershell instead of mmc but don't know exactly what the parameters should be.
    have tried things like:

    PS C:\Windows\system32> Get-Certificate -Template TPM2 -SubjectName "dc.winlabnet.net\certsrv"
          -DNSName dc.winlabnet.net   -CertStoreLocation cert:\LocalMachine\My
    Get-Certificate : CX509PolicyServerUrl::_GetStringProperty: The requested property value is empty. 0x80094004
    (-2146877436 CERTSRV_E_PROPERTY_EMPTY)
    At line:1 char:1

    Then I thought maybe I need the Url parameter and tried this:

    PS C:\Windows\system32> Get-Certificate -Template TPM2 -SubjectName "dc.winlabnet.net\certsrv"
          -DNSName dc.winlabnet.net -URL https://dc.winlabnet.net/policy/service.svc   -CertStoreLocation cert:\LocalMachine
    Get-Certificate : CX509EnrollmentPolicyWebService::LoadPolicy: The remote endpoint does not exist or could not be
    located. 0x803d000d (-2143485939 WS_E_ENDPOINT_NOT_FOUND)
    At line:1 char:1

    But as you can see with no success. Do you know what is wrong and how to find what the parameters should be in my case?

    Monday, January 23, 2017 12:44 PM