Retired Microsoft Blog disclaimer

This directory is a mirror of retired "Windows PKI Team" TechNet blog and is provided as is. All posting authorship and copyrights belong to respective authors.

Posts on this page:

Original URL: https://blogs.technet.microsoft.com/pki/2009/09/09/how-to-get-request-statistics-by-template-in-powershell/
Post name: How to get request statistics by template in PowerShell
Original author: Alex Radutskiy [MSFT]
Posting date: 2009-09-09T19:03:00+00:00


I’ve been working with our support folks helping one of our customers. One of the things we wanted to learn about the environment is how many requests have been made for each certificate template that they issue. We have come up with this PowerShell script that you can run against a CA to find out.


Disclaimer

The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind.


Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose.


The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.


certutil -view -out CertificateTemplate -restrict "NotBefore > 08/20/2009" csv > out.txt
$FileContents = gc out.txt
write-host "Total rows:" $FileContents.length
$GroupedCounts = $FileContents | group | sort count –Descending
$GroupedCounts | format-table Count,Name -auto

The output will look something like this:


Total rows: 10
Count Name
----- ----
4 "1.3.6.1.4.1.311...X
3 "1.3.6.1.4.1.311...Y
1 "8/20/2009 12:00 AM""Certificate Template"
1 "DomainController"
1 "EMPTY"


Let’s take a look at the script closely and also talk about what can be tweaked.


First, we run a certutil.exe to dump the template’s name or OID. The V1 templates are recorded by their name and V2/V3 templates are recorded by their OID. You can see template OIDs with the certutil.exe -template command. You can’t see it in the template snapin UI.


Note that we restrict the output by date. Some other filters that could be useful are CertificateTemplate and Request.StatusCode if you want to get counts for only template or if you’re only interested in failed requests for example. We pipe the output into a text file. We also use the -csv option so that our output is easier to consume for automation.


We then group the output by the template name/OID and sort it based on the count in the descending order. Finally we output it as a table.


Now let’s take a look at the output. Note that the last and third line from the bottom contains garbage. If you’re going to use the output of this script in some automation, you would need to get rid of those entries. They are simply an artifact of the certutil.exe output.

Original URL: https://blogs.technet.microsoft.com/pki/2009/09/02/active-directory-certificate-services-features-by-sku/
Post name: Active Directory Certificate Services Features by SKU
Original author: JField
Posting date: 2009-09-02T19:04:00+00:00


We’ve had many requests for what services and features are available in what Windows Server version and SKU.

The TechNet Wiki article Active Directory Certificate Services Overview has this information under Features of AD CS in Different OS Versions.

Original URL: https://blogs.technet.microsoft.com/pki/2009/08/28/vishals-nuggets/
Post name: Vishal’s nuggets
Original author: MS2065 [MSFT]
Posting date: 2009-08-28T16:55:07+00:00


Subscribe to Vishal’s blog at http://blogs.technet.com/vishalagarwal/ for real good certificate and CA management scripts. More posts to come …

Original URL: https://blogs.technet.microsoft.com/pki/2009/08/24/cross-forest-certificate-enrollment-white-paper-update/
Post name: Cross-forest certificate enrollment white paper update
Original author: Alex Radutskiy [MSFT]
Posting date: 2009-08-24T23:30:00+00:00



We’ve just updated the Beta version of the cross-forest certificate enrollment white paper. In addition to fixing some of the bugs we had in the previous version, we’ve added sections around supporting selective authentication, enrollment web pages, and provided a script to delete PKI objects from AD. This is pretty much the final version. It may get edited and formatted based on the latest doc template before it gets onto the TechNet site, but the technical content is complete. The paper can be found in the same location: http://go.microsoft.com/fwlink/?LinkId=139681. Enjoy!


Alex Radutskiy


Program Manager, Windows Security

Original URL: https://blogs.technet.microsoft.com/pki/2009/08/23/creating-self-signed-certificates-with-a-script/
Post name: Creating self-signed certificates with a script
Original author: Alex Radutskiy [MSFT]
Posting date: 2009-08-23T15:47:00+00:00


Here is a great post by one of my colleagues on how to create a self-signed certificate using PowerShell: http://blogs.technet.com/vishalagarwal/archive/2009/08/22/generating-a-certificate-self-signed-using-powershell-and-certenroll-interfaces.aspx.