Quantcast
Channel: Public Key Infrastructure PowerShell module
Viewing all articles
Browse latest Browse all 729

Commented Unassigned: Cannot convert value "ca.example.com" to type "PKI.CertificateServices.CertificateAuthority" [93]

$
0
0
PS PKI 3.1.0

I managed to get some code working beautifully on my Windows 7 SP1 workstation, but it throws an error when I try to run it locally on my Windows Server 2012 R2 standalone root certificate authority. I think I've narrowed it down to the one line below. I'm so close...so close!

It throws an error on server ca.example.com: Windows Server 2012 R2 (domain-joined standalone root CA)

```
Import-Module PsPKI
$CertificateRequestResponse = Submit-CertificateRequest -CertificationAuthority "ca.example.com" -Path "\\fs.example.com\path\to\certificates\CertReq.csr"
Submit-CertificateRequest : Cannot process argument transformation on parameter 'CertificationAuthority'. Cannot convert value "ca.example.com" to type
"PKI.CertificateServices.CertificateAuthority". Error: "There is no such object on the server.
"
At line:2 char:81
+ ... ationAuthority "ca.example.com" -Path "\\fs.example.com\path\to\certi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Submit-CertificateRequest], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Submit-CertificateRequest

$CertificateRequestResponse
```

It works fine on workstation wx.example.com: Windows 7 SP1 (domain-joined workstation with RSAT)

```
Import-Module PsPKI
$CertificateRequestResponse = Submit-CertificateRequest -CertificationAuthority "ca.example.com" -Path "\\fs.example.com\path\to\certificates\CertReq.csr"
$CertificateRequestResponse


CertificationAuthority : PKI.CertificateServices.CertificateAuthority
RequestID : 22
Status : UnderSubmission
Certificate :
ErrorInformation : Taken Under Submission
```
Comments: You're definitely onto something! ```Connect-CA``` is now working, but naturally, something else broke. :) Code ``` Function Handle-Error { Param ( [PSObject]$Error ) Process { $Error[0].Exception.InnerException.Message $Error[0].Exception.InnerException.StackTrace } } Write-Host "# Import-Module PsPKI" Try { Import-Module PsPKI } Catch { Handle-Error -Error $Error[0] } Write-Host "# Connect-CA" Try { Connect-CA } Catch { Handle-Error -Error $Error[0] } ``` Output ``` # Import-Module PsPKI Add-Type : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PsPKI\PSPKI.psm1:2 char:1 + Add-Type -Path $PSScriptRoot\Library\PKI.Core.dll -ErrorAction Stop + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeCommand Import-Module : The module to process 'PSPKI.psm1', listed in field 'ModuleToProcess/RootModule' of module manifest 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PsPKI\PsPKI.psd1' was not processed because no valid module was found in any module directory. At C:\Users\ag-admin\Desktop\Test1.ps1:14 char:5 + Import-Module PsPKI + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (PsPKI:String) [Import-Module], PSInvalidOperationException + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand # Connect-CA DisplayName ComputerName IsAccessible ServiceStatus Type ----------- ------------ ------------ ------------- ---- CTAG AG-CA.exec.ds.state.ct.us True Running Standalone Root CA ```

Viewing all articles
Browse latest Browse all 729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>