I'm already using 2 queries. I think there are some misunderstanding. My plan is:
I'm doing it using this code:
Get-ChildItem $pathCertSuspendedValidExport -Name|ForEach-Object -Process {$SN=$_ -replace ".cer"; Connect-CertificationAuthority -ComputerName $CN|Get-IssuedRequest -Filter "Disposition -eq 20","NotAfter -ge $DT","SerialNumber -eq $SN" -Property "RawCertificate"| %{[IO.File]::WriteAllText("$pathCertIssuedExport\$($_.SerialNumber).cer", $_.RawCertificate)}}
but it causes many calls (number equals to files in Suspended folder quantity. I've asked about how to avoid using many calls in this situation.
- Valid issued certificates -> Issued folder
- Lapsed issued certificates -> Lapsed folder with removing from Issued folder
- Valid revoked certificates -> Revoked folder with removing from Issued folder
- Valid suspended certificates -> Suspended folder
- Lapsed revoked certificates -> Lapsed folder with removing from Revoked & Suspended folders
-
Renewed certificates -> Issued folder with removing from Revoked & Suspended folders
I'm doing it using this code:
Get-ChildItem $pathCertSuspendedValidExport -Name|ForEach-Object -Process {$SN=$_ -replace ".cer"; Connect-CertificationAuthority -ComputerName $CN|Get-IssuedRequest -Filter "Disposition -eq 20","NotAfter -ge $DT","SerialNumber -eq $SN" -Property "RawCertificate"| %{[IO.File]::WriteAllText("$pathCertIssuedExport\$($_.SerialNumber).cer", $_.RawCertificate)}}
but it causes many calls (number equals to files in Suspended folder quantity. I've asked about how to avoid using many calls in this situation.