locked
Import-Certificate - Exception from HRESULT: 0x800710D8 RRS feed

  • Question

  • I have a script which is run within SCCM application package and which install the certificate.

    This is the code I use:

    Import-Certificate -FilePath "Path\to\certificate.cer" -CertStoreLocation "Cert:\LocalMachine\Root"

    Import-Certificate -FilePath "Path\to\certificate.cer" -CertStoreLocation "Cert:\LocalMachine\CA"



    For both certificates I see this error in the installation log:

    PS>TerminatingError(New-Object): "Exception calling ".ctor" with "1" argument(s): "The object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8)""

    What does this mean and why do I get it ?

    ...but certificates are installed, if I run

    Get-ChildItem -Path "Cert:\" -Recurse | where {$_.Thumbprint -eq "<thumbprint>"}

    I see the certificates are installed. So I don't understand why this error is being shown.

    Also, if I run the this commands manually as an administrator, then I don't get this errors.

    Please, suggest how to avoid this errors ?

    • Edited by LL159159 Wednesday, May 9, 2018 6:08 AM
    Wednesday, May 9, 2018 6:07 AM

Answers

  • Obviously the solution is to ignore this Exception messages and go on with the live... :-)
    • Marked as answer by LL159159 Friday, May 11, 2018 11:29 AM
    Friday, May 11, 2018 11:29 AM

All replies

  • Hi,

    What do you get if you use this for example?

    Get-ChildItem -Path C:\Import\certificate.cer | Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root

    Kind regards,
    Leon


    Don't forget to visit my blog The System Center Blog

    Wednesday, May 9, 2018 6:35 AM
  • If the certs are installed then why are you trying to import them?


    \_(ツ)_/

    Wednesday, May 9, 2018 6:37 AM
  • Hi,

    What do you get if you use this for example?

    Get-ChildItem -Path C:\Import\certificate.cer | Import-Certificate -CertStoreLocation Cert:\LocalMachine\Root

    Kind regards,
    Leon


    Don't forget to visit my blog The System Center Blog

    The same.. actually this method I tried first...
    Wednesday, May 9, 2018 8:11 AM
  • If the certs are installed then why are you trying to import them?


    \_(ツ)_/

    This commands do import/install (don't know what's the correct word) certificate but I don't understand why they are also throwing this error message at the same time ?
    Wednesday, May 9, 2018 8:12 AM
  • Obviously the solution is to ignore this Exception messages and go on with the live... :-)
    • Marked as answer by LL159159 Friday, May 11, 2018 11:29 AM
    Friday, May 11, 2018 11:29 AM