PSPKI
PSPKI copied to clipboard
Publish-CRL throws: An attempt was made to access an uninitialized object
Using PSPKI 3.7.2, when trying to run Publish-CRL -CertificationAuthority XXXXIntermediateCAv2 I get the following error:
Exception calling "PublishCRL" with "2" argument(s): "An attempt was made to access an uninitialized object."
At C:\Program Files\WindowsPowerShell\Modules\PSPKI\3.7.2\Server\Publish-CRL.ps1:15 char:4
+ $CA.PublishCRL($DeltaOnly, $UpdateFile)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : UninitializedObjectException
If I try this another method, I get this..
PS C:\Windows\system32> Get-CertificationAuthority | Publish-CRL
Exception calling "PublishCRL" with "2" argument(s): "CCertAdmin::PublishCRLs: The parameter is incorrect. 0x80070057
(WIN32: 87 ERROR_INVALID_PARAMETER)"
At C:\Program Files\WindowsPowerShell\Modules\PSPKI\3.7.2\Server\Publish-CRL.ps1:15 char:4
+ $CA.PublishCRL($DeltaOnly, $UpdateFile)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException
Any idea why this is happening?
do you receive your CAs when calling Get-CertificationAuthority
and are they online and accessible?
Same issue here, also on v3.7.2 Get-CertificationAuthority results in:
Name : <redacted>
DisplayName : <redacted>
ComputerName : <redacted>
ConfigString : <redacted>
DistinguishedName : CN=<redacted>,CN=Enrollment Services,CN=Public Key
Services,CN=Services,CN=Configuration,<redacted>
Type : Enterprise Subordinate CA
IsEnterprise : True
IsRoot : False
OperatingSystem : Microsoft Windows Server 2019 Datacenter
IsAccessible : True
RegistryOnline : True
ServiceStatus : Running
SetupStatus : ServerInstall, SecurityUpgraded, ServerIsUptoDate
Certificate : [Subject]
<redacted>
[Issuer]
<redacted>
[Serial Number]
<redacted>
[Not Before]
<redacted>
[Not After]
<redacted>
[Thumbprint]
<redacted>
BaseCRL :
DeltaCRL :
EnrollmentServiceURI :
EnrollmentEndpoints : {}
Publish-CRL -CertificationAuthority $ca.Name gives the same error as OP. In my case this is a blank setup.
Getting the same error as OP:
$CAName = 'My CA'
$CAObj = Get-CertificationAuthority -Name $CAName
$CAObj | Publish-CRL
Exception calling "PublishCRL" with "2" argument(s): "CCertAdmin::PublishCRLs: The parameter is incorrect. 0x80070057 (WIN32: 87 ERROR_INVALID_PARAMETER)"
At C:\Program Files\PKI Solutions\PowerShell Modules\PSPKI\Server\Publish-CRL.ps1:15 char:4
+ $CA.PublishCRL($DeltaOnly, $UpdateFile)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException
@jimbju what returns your $CAObj
variable?
@Crypt32 contents of $CAObj
:
DisplayName ComputerName IsAccessible ServiceStatus Type
----------- ------------ ------------ ------------- ----
My CA mycacomputername... True Running Enterprise Subordinate CA
$CAObj.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True False CertificateAuthority System.Object
Fixed in v4.0.0