Weird (?) Output...

Jun 27, 2012 at 2:28 PM

I imagine this question has been asked before - but I cannot find the answer after googling for a few minutes.

When I run a command such as: 

Get-IssuedRequest -CA (get-ca -name myCa)

I get a goodly amount of output that I want, but there are a ton of lines that look like this:

1203.525.0:<2012/6/27, 10:26:41>: 0x80004002 (-2147467262)

 

I cannot find a way to suppress these messages (even piping stdout and stderr to $null). Is there something I'm missing?

Coordinator
Jun 27, 2012 at 2:54 PM

I'm aware about this issue and it sounds like a bug in underlying ICertView2 COM interface. As per my tests, an error is thrown after processing about 10k rows (really, the number of processed rows is random). You can try to suppress errors by using '-ErrorAction SilentlyContinue' parameter when calling Get-IssuedRequest:

Get-CA -name MyCA | Get-IssuedRequest -ErrorAction SilentlyContinue
Jun 27, 2012 at 5:24 PM

Thank you for the update and the suggestion. Unfortunately, the ErrorAction (also WarningAction) seems to have no effect on the output.

Other things I've tried:

Get-CA -name myCa | Get-IssuedRequest 2>&1 > $null  #to pipe everything to $null. I still see those messages.

Various options of turning off Debug and Verbosity (before I learned that it might be a bug in the ICertView2 COM interface). 

Anyway - thanks for the quick response!

Coordinator
Jun 27, 2012 at 6:13 PM

please, can you show full error message?

Jun 27, 2012 at 6:18 PM

Below is generally what I see. I commented out company-specific information. But this type of thing goes on for thousands of lines.
The command used to generate it was: get-issuedrequest -ca (get-ca -name myCa)

1203.525.0:<2012/6/27, 14:15:13>: 0x80004002 (-2147467262)
1203.525.0:<2012/6/27, 14:15:13>: 0x80004002 (-2147467262)
1203.525.0:<2012/6/27, 14:15:13>: 0x80004002 (-2147467262)
1203.525.0:<2012/6/27, 14:15:13>: 0x80004002 (-2147467262)
RequestID             : 5438
Request.RequesterName : COMMENTED-OUT
CommonName            : COMMENTED-OUT
NotBefore             : 6/25/2012 12:46:27 PM
NotAfter              : 6/25/2014 12:46:27 PM
SerialNumber          : COMMENTED-OUT
ConfigString          : COMMENTED-OUT

1203.525.0:<2012/6/27, 14:15:13>: 0x80004002 (-2147467262)
1203.525.0:<2012/6/27, 14:15:13>: 0x80004002 (-2147467262)
1203.525.0:<2012/6/27, 14:15:13>: 0x80004002 (-2147467262)
1203.525.0:<2012/6/27, 14:15:13>: 0x80004002 (-2147467262)
RequestID             : 5439
Request.RequesterName : COMMENTED-OUT
CommonName            : COMMENTED-OUT
NotBefore             : 6/25/2012 12:46:27 PM
NotAfter              : 6/25/2014 12:46:27 PM
SerialNumber          : COMMENTED-OUT
ConfigString          : COMMENTED-OUT

 

Coordinator
Jun 27, 2012 at 7:00 PM

I see this behavior first time. Redirections doesn't work because these messages (as I see) are sent to console output stream. You can check this by running:

Get-CA -name myCa | Get-IssuedRequest > $null

you should see only '1203.525.0:<2012/6/27, 14:15:13>: 0x80004002 (-2147467262)' output. If this is true, then it can be another bug in ICertView2.

Jun 27, 2012 at 7:10 PM

That's right - I mentioned in my second post that I had tried this:

Get-CA -name myCa | Get-IssuedRequest 2>&1 > $null  #to pipe everything to $null. I still see those messages.

The 2>&1 > $null  should be read as: "Pipe STDErr to STDOut, Pipe STDOut to null" - thus all messages, STDERR and STDOUT, get piped to null. In my testing, I still received the "1203.525.0:..." messages. So it seems as though another process or COM object is writing to my console and not subject to output redirection.

Coordinator
Jun 27, 2012 at 7:36 PM

This is something I can't fix, because my module nothing writes to console stream (you can check Get-RequestRow.ps1 file). I can forward this issue to Windows PKI team and I may need additional details about your configuration. You can send me the following information:

1) operating system version;

2) how many rows (approximately) you see in Issued Request folder (in Certification Authority MMC)?

3) at which point you see these messages (how many rows are normally processed before error messages are displayed)

4) how many messages you see? Or is there any logic? Say, after certain point you see 4 error lines per each subsequent row (as I see in your output, this information included between 2 subsequent row entries). You will find Contact button in my profile page (under avatar).

thanks!

BTW:

> to pipe everything to $null

this is not correct. PowerShell has various streams which includes default stream, error stream and PowerShell-specific streams: warning, verbose and debug streams. Though, obviously, COM interfaces cannot write to PowerShell-specific streams, because they are not aware about PowerShell. Also PowerShell parser exceptions are not handled by redirection operators. Consider the following:

1/0  2>&1 > $null

since division by zero errors are handled by parser *before* execution, the error is not suppressed by the redirection operator.

Oct 24, 2013 at 8:07 AM
Edited Oct 24, 2013 at 8:08 AM
The same problem here.
Is there a solution out there?

Here is the input
Get-CertificationAuthority "$caname.$domaindns" | Get-IssuedRequest -Filter "CertificateTemplate -eq CEP-VErschlüsselung"
Here is the output:
603.121.0:<2013/10/24, 10:4:2>: 0x80010106 (-2147417850)
603.121.0:<2013/10/24, 10:4:2>: 0x80010106 (-2147417850)
CertLib: Restriction{
        Col:Request.Disposition(9)
        Seek:==
        Sort:None
        Val:20
}
CertLib: Restriction{
        Col:CertificateTemplate(42)
        Seek:==
        Sort:None
        Val:1.3.6.1.4.1.311.21.8.7025051.4768367.9260986.4963396.8357667.39.7233892.12628878
}
1206.610.0:<2013/10/24, 10:4:2>: 0x80004002 (-2147467262)
1206.610.0:<2013/10/24, 10:4:2>: 0x80004002 (-2147467262)
1206.610.0:<2013/10/24, 10:4:2>: 0x80004002 (-2147467262)
1206.610.0:<2013/10/24, 10:4:2>: 0x80004002 (-2147467262)
1203.525.0:<2013/10/24, 10:4:2>: 0x80004002 (-2147467262)
1203.525.0:<2013/10/24, 10:4:2>: 0x80004002 (-2147467262)
1203.525.0:<2013/10/24, 10:4:2>: 0x80004002 (-2147467262)
1203.525.0:<2013/10/24, 10:4:2>: 0x80004002 (-2147467262)


RequestID             : 5695
Request.RequesterName : COMMENTED-OUT
CommonName            : COMMENTED-OUT
NotBefore             : 22.10.2013 15:02:24
NotAfter              : 21.10.2018 15:02:24
SerialNumber          : COMMENTED-OUT
ConfigString          : COMMENTED-OUT
Coordinator
Oct 24, 2013 at 4:17 PM
I had a talk with Windows PKI team and, unfortunately, there is no way to disable these debug messages.