PSPKI modue Get-IssuedRequest cause problem when used with scheduled task

Oct 13, 2014 at 3:46 PM
Hello everyone,

I'm writing a script which gets issued certificates within the last 60 days and export the result to a html table.

I used the following command line:
Get-CertificationAuthority $CAName | Get-IssuedRequest -Property EnrollmentFlags -Filter "NotAfter -ge $today" , "NotAfter -le $endperiod"
When i call the script interactively in a PS Window, i managed to get all the requested certificates. However when i used a scheduled task there aren't any certificates.

Any ideas?

Many thanks in advance

Muriel
Coordinator
Oct 15, 2014 at 2:58 PM
This can be caused du to various issues. For example, authentication issue (when connecting to CA database), maybe task configuration task or whatever else. For sure, it is not a PSPKI issue. You must check the permissions of the account associated with the scheduled task, ensure that the script is executed (maybe, command-line and|or parameters are incorrect) at all. You can add Start- and Stop-Transcript commands at the beginning and the end of the script to get the output of executed commands and to see what is wrong there.