Welcome to TechNet Blogs Sign in | Join | Help

Windows CA Performance Numbers

Below are some numbers we have measured when testing the Windows CA in our lab environment.

Note that the numbers will change and depends on many factors (network topology, request types, other server workloads, etc.) However, the numbers are a good starting point for capacity planning and can later be verified in pre-production environment.

Windows 2008 RTM: CA throughput with 2K RSA key

·        CAPI software RSA 2048

·        Enterprise CA (dedicated machine)

·        Rack Server: 7900$ Mid 2007:

o   Dual-Core

o   4 GB RAM

o   146 GB x 8 10K RPM 4.1MS Serial Attached SCSI

·        Results are ~125 req/sec (no archived keys)

·        Processing time ~250mS (server time)

Windows 2008 RTM: CA throughput with 1K RSA key

·        CAPI RSA 1024

·        Enterprise CA (dedicated machine) – 500 DB sessions

·        Rack Server: 7900$ Mid 2007:

o   x64

o   Dual proc: Dual-Core

o   4 GB RAM

·        146 GB x 8 10K RPM 4.1MS Serial Attached SCSI

·        Results are ~155 req/sec (no archived keys)

·        Processing time ~250mS – server time

Windows 2008 R2 RTM: CA Database scalability testing

·        CNG 2K key

·        Rack Server:

o   Dual proc: Dual-Core

o   4 GB RAM

o   8x136GB SCSI drives (1 drive for OS, 7 drives in RAID0 for DB storage)

·        Rows in database: 100565869

·        Log files created: 1462812, was able to witness roll over to larger filenames

·        DB size: 871 GB (936,160,403,456 bytes)

·        Time to reach 100M rows: ~9.5 days (~125 req/sec)

How did we test?

Here are some details on how we are submitting the requests during our performance tests.

The key is to get enough data to load the CA service to an upper bound (80 to 90% CPU utilization).

Certreq.exe will work because the client will be spending too much time generating the key, generating the request, etc… 

1)  CA Config:

a.  CA DBSessions is configured to 500 (from default of 100)

b.  For Enterprise CA tests, template is modified to remove "publish cert to AD”

2)  Cert Request:

a.  Private Key generated once

b.  Use X509Enrollment API to initialize and create request

c.  Submit request via ICertRequest2::Submit API

3)  Machine Topology:

a.  1 – DC

b.  1 – CA

c.  4 – Client machines

                        i.   Each client machine hosts 50 users

                      ii.   Each user submits 100000 pre-generated cert requests

 

Posted by oshekel | 0 Comments

Clustered Certification Authority maintenance tasks

The colleagues from the AskDS blog posted a quite valuable article about Clustered CA maintenance tasks.

Posted by MS2065 | 0 Comments

Server 2008 R2 ADCS Migration Guide Beta

The beta version of the new 2008 R2 ADCS Migration Guide is now available at http://technet.microsoft.com/en-us/library/ee126140(WS.10).aspx.

The guide describes the necessary steps for a successful migration of enterprise or standalone CAs from Windows Server 2003 and Windows Server 2008 to Windows Server 2008 R2. Also included are steps for migration to Server Core.

This is a beta release and customer feedback would be greatly appreciated in in order to ensure the final release is all it can be.  The final version is scheduled for release in March 2010.  Feedback instructions are provided on the page.  

Posted by ltalbot | 0 Comments

AD Schema Requirements for Windows PKI features

There have been a number of questions about Active Directory (AD) schema requirements for the Windows PKI features so I decided this deserves a blog post.

Cheat sheet

1. Version 2 and Version 3 certificate templates require Windows Server 2003 (version 30) or later schema. It doesn’t matter if CA that issues them is based on 2003, 2008, or 2008 R2 server.

2. Credential Roaming requires schema that was shipped in Windows Server 2008 (version 34) OR older schema that is extended manually as documented in this white paper.

3. Certificate Enrollment Web Services require schema that was shipped with Windows Server 2008 R2 (version 47).

Frequently Asked Questions

Q: Does Windows 2008 CA require AD schema update?

A: No.

Q: But Brian Komar’s book says it does?

A: Still no. This is simply an error in the book.

Q: Does Windows 2008 R2 CA require AD schema update?

A: No, but see #3 above. If you actually want to use new web services, you need 2008 R2 schema.

 

Alex Radutskiy

Senior Program Manager, Windows Security

Posted by alrad | 0 Comments

How Certificates Are Created

The following text is a simple copy/paste from the TechNet article How Certificates Work (section How Certificates are Created). Why am I posting this information to the blog? Quite simple: I recognize that it is often overlooked that the key pair generation is always the very first step of a certificate creation.

Certificates are issued by a CA, which can be any trusted service or entity willing to verify and validate the identities of those to whom it issues certificates and their association with specific keys. Companies might issue certificates to employees, schools might issue certificates to students, and so on. Of course, a CA’s public key must be trustworthy or the certificates it issues will not be trusted. Because anyone can become a CA, certificates are only as trustworthy as the authority that issues the underlying keys.

The following six steps describe the process of requesting and issuing a certificate.

  1. Generate a key pair - The applicant generates a public and private key pair or is assigned a key pair by some authority in his or her organization. (at a command-line, this part is covered by any certreq –new command)
  2. Collect required information - The applicant collects whatever information the CA requires to issue a certificate. The information could include the applicant’s e-mail address, birth certificate, fingerprints, notarized documents — whatever the CA needs to be certain that the applicant is who he or she claims to be. CAs with stringent identification requirements produce certificates with high assurance — that is, their certificates generate a high level of confidence. CAs themselves are said to be of high, medium, or low assurance (at a command-line, this part is covered by any certreq –new command).
  3. Request the certificate - The applicant sends a certificate request, consisting of his or her public key and the additional required information, to the CA. The certificate request, which is signed with the client’s public key, can also be encrypted by using the CA’s public key. Many requests are made by using e-mail, but requests can also be sent by postal or courier service — for example, when the certificate request itself must be notarized. (at a command-line, this is done with certreq –submit)
  4. Verify the information - The CA applies whatever policy rules it requires to verify that the applicant should receive a certificate. As with identification requirements, a CA’s verification policy and procedures influence the amount of confidence generated by the certificates it issues.
  5. Create the certificate - The CA creates and signs a digital document containing the applicant’s public key and other appropriate information. The signature of the CA authenticates the binding of the subject’s name to the subject’s public key. The signed document is the certificate.
  6. Send or post the certificate - The CA sends the certificate to the applicant or posts the certificate in a directory, as appropriate (at a command-line, this is done with certreq –accept)
Posted by MS2065 | 0 Comments

Certificate Revocation Checking Whitepaper

A whitepaper on Certificate Revocation Checking in Windows Vista and Windows Server 2008 has been publshed on Technet here - http://technet.microsoft.com/en-us/library/ee619730(WS.10).aspx

Topics in this whitepaper include:

·         What’s new in Windows Vista and Windows Server 2008 revocation checking

·         How revocation checking works

·         How pre-fetching revocation information improves performance

·         Support for independent OCSP signer and custom OCSP URLs

·         Recommendations for optimizing the revocation experience

·         Managing OCSP Settings with Group Policy

 

You can also download a copy of the paper here - http://go.microsoft.com/fwlink/?LinkId=145008 

The content also applies to Windows 7 and Windows Server 2008 R2.

 

Please let me know if you have questions/feedback: ymehta@microsoft.com

 

Certificate Validation on Windows XP with Entrust SSP Issued HSPD-12 Certificates

On May 9th, 2009 Entrust Managed Services (provider of HSPD-12 certificates) performed a key update ceremony on the Entrust Managed Services Root and SSP certification authorities. HSPD-12 certificates issued after May 9th, 2009 will not work on the Windows XP operating system (i.e. RTM, SP1, SP2 and SP3).

More information can be found here:

http://blogs.technet.com/futurefedtech/default.aspx

 

Posted by oshekel | 0 Comments

BranchCache Deployment Guide for Windows Server 2008 R2 and Windows 7

A new deployment guide was published on Windows7 BranchCache.

It covers the PKI requirements for this feature along with other deployment procedures.

 

The full guide can be found here:

BranchCache Deployment Guide for Windows Server 2008 R2 and Windows 7

Posted by oshekel | 1 Comments

Introducing Certificate Template API

WARNING: USE OF THE SAMPLE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this sample code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

In this post I would like to talk about how a developer can package a certificate template as a resource in their application to be later installed in a customer environment. This post assumes that you have good understanding of the Enterprise CAs, certificate templates, and Active Directory.

Here is one possible scenario. Let’s say your application uses a certificate for communication between its client and server components. You have specific requirements as to what that certificate should look like. Your application is meant to work in Windows environment so you want to take advantage of Windows CA and autoenrollment and have CA issue certificates for you clients so you don’t have to worry about the certificate enrollment yourself. But how do you configure CA and more importantly certificate template from your code? Before Windows Server 2008 R2 your only solution to those is to provide documentation for your admins on how to do it manually or go directly to AD using LDAP and modify certificate template objects (this option is a hack and not supported by the way).

In Windows Server 2008 R2 and Windows 7 we’ve added an API that will let developers to do the template setup in code in a supported way. As a developer you will actually need a Windows Server 2008 R2 installation in your test environment to create your resource, but your application can run on either Windows Server 2008 R2 or Windows 7. This will become clear as I go through the steps in this post.

First, a little historical perspective to understand why going directly to AD to modify certificate templates is not supported. Certificate templates have been around for a while and were not even customizable originally. When customization was added a lot of rules about what settings make sense were implemented in the certificate template MMC snap-in (certtmpl.msc). For example, you can only select to archive a private key on a certificate template that has encryption purpose. There are many more rules like that. These rules ensured that certificate templates are always “good” and allowed some assumptions to be made in the code that actually used the templates. Hence, we don’t want others to mess with certificate templates outside of our snap-in. However, as the number of applications that used certificates grew, we started receiving request to programmatically create certificate templates.

So how do you do it? At the very high level the process looks like this:

At the development time:

1. Setup a test MS PKI environment including a DC, CA, Certificate Enrollment Policy Service, and Certificate Enrollment Service.

2. Configure a template as desired.

3. Export a template.

4. Include exported template in your application and develop a code that will import it at the execution time.

At the setup execution time

1. Import exported template to your customer’s AD environment.

2. Configure a CA to issue a template.

Development Time

Most of the work will have to happen during development (more importantly all of the manual work).

Environment Setup

Before you can create and export a certificate template, you need to setup a proper environment. You need only one Windows Server 2008 R2 machine for that.

First of all, we need an Enterprise CA and of course a DC because templates are stored in Active Directory. Don’t worry about the names you use for you CA, DC, or domain. None of that stuff will be exported by our API.

Then you need to setup Certificate Enrollment Policy Service and Certificate Enrollment Service. These are new role services for the ADCS server role in Windows Server 2008 R2. To learn more about these role services see this page. The reason we need them is because we want to leverage the XML that they produce to export our template.

Template Configuration

Now configure a template that you application needs by duplicating one of the default templates. Don’t bother with the security settings (more on that later) except for making sure that your test user account that you are going to use during export has Read and Enroll permissions on the template. If you need more than one template, configure them as well. Our API can handle exporting/importing of multiple templates.

Once you have configured the template(s), add it for issuance on your CA and remove all other templates. This will ensure that you only export what you need.

Exporting a Template

You need to write a little code to export a template. This code doesn’t need to be included in the actual application since the application only requires the import. Here is sample code that exports templates to a file:

   1: //
   2: // exports template from a policy server and saves the data
   3: // into some file. Defaulting to a user context and kerb auth. 
   4: //
   5: static void Export(string policyServerURL, string fileName)
   6: {
   7:     //
   8:     // Get template data from policy server
   9:     //
  10:     IX509EnrollmentPolicyServer policyServer = new CX509EnrollmentPolicyWebServiceClass();
  11:     policyServer.Initialize(
  12:         policyServerURL, 
  13:         null, 
  14:         X509EnrollmentAuthFlags.X509AuthKerberos, 
  15:         false, 
  16:         X509CertificateEnrollmentContext.ContextUser
  17:         );
  18:     policyServer.SetCredential(0, X509EnrollmentAuthFlags.X509AuthKerberos, null, null);
  19:     policyServer.LoadPolicy(X509EnrollmentPolicyLoadOption.LoadOptionReload);
  20:  
  21:     //
  22:     // export template data and save it to a file
  23:     //
  24:     byte[] exportedData = (byte[])policyServer.Export(
  25:         X509EnrollmentPolicyExportFlags.ExportOIDs | X509EnrollmentPolicyExportFlags.ExportTemplates
  26:         );
  27:     using(FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None))
  28:     {
  29:         fs.Write(exportedData, 0, exportedData.Length);
  30:     }
  31: }

 

Although, the APIs are documented in the MSDN, I will add few words on the parameters and the general flow of the code here.

First we create an instance of an object that implements IX509EnrollmentPolicyServer interface and represents a Certificate Enrollment Policy Service. We initialize it with its URL that you can get from the IIS snap-in -> Default Web Site -> properties of an application that has “PolicyProvider_CEP” in its name. The AuthFlags are set based on the authentication option you chose during Certificate Enrollment Policy Service setup. I’ve used Kerberos here as this the easiest one to deal with. The Context parameter is set to ContextUser so make sure you ACL template so that the user account executing this code has access.

Then we call SetCredential() method with a X509EnrollmentAuthFlags.X509AuthKerberos type. No other parameters need to be set as this type uses Windows Integrated authentication.

After that we call LoadPolicy() which actually retrieve the Certificate Enrollment Policy Service end point. We use X509EnrollmentPolicyLoadOption.LoadOptionReload to avoid caching. More on that later.

Finally we export the template data and associated OID objects and write them to a file. Later we can package that file into our application for import at the run time.

A word of caution on caching… If you’re playing with a template by changing its properties and trying to export it, there several caches that you should be aware of. First the cache that the APIs maintain on each client. That cache can be avoided by passing X509EnrollmentPolicyLoadOption.LoadOptionReload option to the LoadPolicy() method call as I have done above. Second cache exists on the Certificate Enrollment Policy Service side. To avoid this cache go to the IIS manager snapin -> Default Web Site -> *CEP* -> Application Setting and create a RetryIntervalMs application setting and set it to something small like 1000. This makes policy service to refresh its cache every second.

Execution Time

There are several tasks that you would need to do at the setup and uninstall time.

Setup

During setup process, you want to load the exported template data and import it into your customer’s Active Directory. Here is a sample code that does that:

   1: //
   2: // Read exported template data from the file
   3: //
   4: static void Import(string fileName)
   5: {
   6:     //
   7:     // read exported template data from a file
   8:     //
   9:     byte[] importedData = null;
  10:     using(FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.None))
  11:     {
  12:         importedData = new byte[fs.Length];
  13:         fs.Read(importedData, 0, importedData.Length);
  14:     }
  15:  
  16:     //
  17:     // Initialize policy server interface with exported data instead of connecting
  18:     // to a real policy server
  19:     //
  20:     IX509EnrollmentPolicyServer importPolicyServer = new CX509EnrollmentPolicyWebServiceClass();
  21:     importPolicyServer.InitializeImport(importedData);
  22:     
  23:     //
  24:     // go through each imported template, set its security descriptor, and 
  25:     // write it to Active Directory
  26:     //
  27:     IX509CertificateTemplates templates = importPolicyServer.GetTemplates();
  28:     foreach (IX509CertificateTemplate template in templates)
  29:     {
  30:         IX509CertificateTemplateWritable writableTemplate = new CX509CertificateTemplateADWritableClass();
  31:         writableTemplate.Initialize(template);
  32:         writableTemplate.set_Property(EnrollmentTemplateProperty.TemplatePropSecurityDescriptor, SDDL);
  33:         writableTemplate.Commit(CommitTemplateFlags.CommitFlagSaveTemplateGenerateOID, null);
  34:     }
  35: }
  36:  
  37: private const string SDDL = 
  38:     "O:EA" + //owner is Enterprise Admins
  39:     "G:EA" + //group is EA as well
  40:     "D:PAI" + //DACL with SE_DACL_PROTECTED and SE_DACL_AUTO_INHERITED 
  41:     "(OA;;CR;a05b8cc2-17bc-4802-a710-e7c15ab866a2;;DU)" + //autoenroll for Domain Users
  42:     "(OA;;RPWPCR;0e10c968-78fb-11d2-90d4-00c04f79dc55;;DA)" + //enroll for Domain Admins
  43:     "(OA;;RPWPCR;0e10c968-78fb-11d2-90d4-00c04f79dc55;;DU)" + //enroll for Domain Users
  44:     "(OA;;RPWPCR;0e10c968-78fb-11d2-90d4-00c04f79dc55;;EA)" + //enroll for Enterprise Admins
  45:     "(A;;CCDCLCSWRPWPDTLOSDRCWDWO;;;DA)" + //all access to Domain Admins
  46:     "(A;;CCDCLCSWRPWPDTLOSDRCWDWO;;;EA)" + //all access to Enterprise Admins
  47:     "(A;;LCRPLORC;;;AU)"; //read for Authenticated Users

First we read the exported data from the same file we used in the export sample.

Then we create an instance of an object that implements IX509EnrollmentPolicyServer and initialize it with data we have read from the file earlier. This time we don’t actually need to call LoadPolicy() method or set the authentication parameters since we don’t need to retrieve the data from the actual Certificate Enrollment Policy Service endpoint.

Finally, we iterate through the template collection and for each template in the collection we create an instance of the writable template object. These objects can actually we written to the Active Directory.

However, before we actually commit the write operation, we need to set the security descriptor property. This property is not exported (it doesn’t make sense to export it actually since it would be meaningless outside of the test environment we’ve used to create a template) and if you don’t set it you will inherit a default setting that would only allow enrollment for your domain admins. Note that at this time you can’t change other properties besides security descriptor.

When we call Commit() method to complete the write operation, we pass the CommitFlagSaveTemplateGenerateOID flag to tell the API to generate an OID for us similar to what the duplicate action does in the certificate template snap-in.

Note that in order for you to add a certificate template, you need write permissions to the Configuration\Services\Public Key Services AD container which in default setup means Enterprise Admins membership.

If you have created custom application policies (aka EKUs) in your test environment by going to the Extensions tab -> Edit -> Add… -> New…, you would need to install those in the customer environment using certutil.exe since the API at this time doesn’t support importing those. Here is how you would do it:

Certutil.exe -f -oid 1.2.3.4.5.6.7.8.9.0 MyEKU 1033 3

What this command does is registers your EKU in Active Directory. We use -f switch to allow certutil.exe to create new object. Then we provide the OID value and the display name. The 1033 is the language ID that will be used by the certificate UI when it encounters this OID in a certificate. For a list of language IDs see this MSDN page. The last parameter specifies the type of OID object we are creating which is the Application Policy type.

To check that registration has been successful in your code just check the return code from certutil.exe. Manually you can run this command:

C:\>certutil.exe -v -oid 1.2.3.4.5.6.7.8.9.0
System default Language Id:: 409 (1033)
1.2.3.4.5.6.7.8.9.0 – MyEKU
pwszName = MyEKU
CRYPT_ENHKEY_USAGE_OID_GROUP_ID (7)
dwValue = 0
0: 1033,TestEKU2
CertUtil: -oid command completed successfully.

Once you have certificate template setup you can use ICertAadmin2::SetCAProperty() method to add your template to be issued by a CA. Here is a sample code on how to do it:

   1: static void AddTemplateToCA(string templateName, string templateOid)
   2: {
   3:     //
   4:     // let user to pick a CA
   5:     //
   6:     ICertConfig2 certConfig = new CCertConfigClass();
   7:     string caConfig = certConfig.GetConfig(0x1 /* CC_UIPICKCONFIG */);
   8:  
   9:     //
  10:     // get current templates that are configured on the CA 
  11:     //
  12:     ICertAdmin2 admin = new CCertAdminClass();
  13:     StringBuilder sb = new StringBuilder(
  14:         (string)admin.GetCAProperty(caConfig, 29 /* CA_PROP_TEMPLATES */, 0, 4 /*string*/, 0)
  15:         );
  16:     
  17:     //
  18:     // add new template to the list and update the CA
  19:     //
  20:     sb.Append(templateName);
  21:     sb.Append("\n");
  22:     sb.Append(templateOid);
  23:     sb.Append("\n");
  24:     object newTemplates = sb.ToString();
  25:     admin.SetCAProperty(caConfig, 29, 0, 4, ref newTemplates);
  26: }

This method takes two parameters the template name and template OID. It is obvious where we get the template name (we created it at the development time), but where is the application can get the OID. You can record it right after you wrote the template to AD by calling the GetProperty() method with the EnrollmentTemplateProperty.TemplatePropOID flag.

Now let’s look at what the code does. First, we use ICertConfig::GetConfig() method to prompt a user to select a CA. Then we query for a currently configured list of templates from that CA. Finally, we modify the list by adding our template to the end of it and by setting the list back on the CA. You need to be an admin on the CA for this code to run.

Uninstall

When your application performs uninstall you need a way to delete a template and/or OIDs that you have created during setup.

The OID deletion is simple and can be achieved by this certutil.exe command:

Certutil.exe -oid 1.2.3.4.5.6.7.8.9.0 delete

To remove a template from a CA, you can use ICertConfig2::Next() method to iterate through all enterprise CAs and use ICertAdmin2 interface to find which CA has your template configured. Removing it from a CA is a reverse operation from what we did in the AddTemplateToCA() sample code earlier.

The deletion of a template is a little bit more involved. Here is a sample code to do it:

   1: //
   2: // Delete a template identified by templateCommonName paramter from AD
   3: // using a DC specified by dcDnsName parameter
   4: //
   5: static void Delete(string templateCommonName, string dcDnsName)
   6: {
   7:     //
   8:     // Get templates from AD
   9:     //
  10:     IX509EnrollmentPolicyServer adPolicyServer = new CX509EnrollmentPolicyActiveDirectoryClass();
  11:     adPolicyServer.Initialize(
  12:         dcDnsName, 
  13:         null, 
  14:         X509EnrollmentAuthFlags.X509AuthKerberos, 
  15:         false, 
  16:         X509CertificateEnrollmentContext.ContextUser
  17:         );
  18:     adPolicyServer.LoadPolicy(X509EnrollmentPolicyLoadOption.LoadOptionReload);
  19:     IX509CertificateTemplates templates = adPolicyServer.GetTemplates();
  20:     
  21:     //
  22:     // go through each template and if a match found delete from AD
  23:     //
  24:     foreach (IX509CertificateTemplate template in templates)
  25:     {
  26:         string currentTemplateCommonName = 
  27:             (string)template.get_Property(EnrollmentTemplateProperty.TemplatePropCommonName);
  28:  
  29:         if (0 == String.Compare(currentTemplateCommonName, templateCommonName, true))
  30:         {
  31:             IX509CertificateTemplateWritable writableTemplate = new CX509CertificateTemplateADWritableClass();
  32:             writableTemplate.Initialize(template);
  33:             writableTemplate.Commit(CommitTemplateFlags.CommitFlagDeleteTemplate, dcDnsName);
  34:             break;
  35:         }
  36:     }
  37: }

This code looks very similar to the import case. First we create IX509EnrollmentPolicyServer instance only this time we use a CX509EnrollmentPolicyActiveDirectoryClass class. Then we get all of the templates currently in AD and go through that collection until we find the one we looking for. Once we find it we delete by calling the Commit() method with the CommitFlagDeleteTemplate flag. You need to have the delete permission on the Configuration\Services\Public Key Services AD container (specifically Certificate Templates container and OID container) for the deletion to succeed.

In my sample I’m specifying a DC name that I want APIs to work with. This is not required. You can just pass null to get a default DC. However, it is a good general practice to use a specific DC to get consistent results. Otherwise different method invocations can actually be performed against different DCs and you may run into problems with AD data not being consistent across DCs you are using.

Posted by alrad | 0 Comments

Using VBScript to install CA on WS2008R2 server core

In my previous post I provided a script used for setup and installation of a CA using VBScript. The same script is capable of installing a CA on server core, where there is no UI available for installing. With the script and a few possible additional steps it's pretty easy to install a CA on server core with just a couple of commands in the CMD.

Steps:

  1. If you need the functionality of WoW64, for example using a network HSM that needs to use 32bit binaries on the 64bit system you will need to install the WoW64 support.
    • Run "Start /w ocsetup ServerCore-WOW64" to install the WoW64 support, reboot the machine after installing this package.
  2. If using an HSM or network HSM install and configure the HSM software by following the instructions provided by the HSM vendor.
  3. Use the setupca.vbs script to install the CA

The setupca.vbs script takes care of installing all the needed packages and files using OCSetup, since servermanagercmd is not available on the core builds.

Posted by shawncor | 0 Comments

Automated CA installs using VB script on Windows Server 2008 and 2008R2 [UPDATED]

Starting with Windows Server 2008 the CA product team introduced a set of COM objects that can be used to control the installation of CAs. Using VBScript you can quickly automate the setup and installation of a CA.Below is a script that is being used by the product team in our testing of Certificate Services. SetupCA.vbs was designed to have the functionality present in the setup UI but in an easy command line that can be used in automation. Most of the functionality of the script is fairly straight forward in just setting properties on the setup object. A couple of features, like the key/cert re-use, take a bit of code to get the setting right.

All of the ICertSrvSetup COM object properties and methods are documented in the MSDN at http://msdn.microsoft.com/en-us/library/bb736371%28VS.85%29.aspx.

The setup script is attached to this post, simply click the link for setupca.vbs and save the file to your local system.

 

Some example usages of the script:

Install Enterprise Root CA
Cscript setupca.vbs /ie /sn MyRootCA /sk 4096 /sp "RSA#Microsoft Software Key Storage Provider" /sa SHA256

Install Standalone Sub CA
Cscript setupca.vbs /it /sn MySubCA /sr MyParentCAMachine\MyRootCA /sk 384 /sp "ECDSA_P384#Microsoft Software Key Storage Provider" /sa SHA1

Uninstall CA:
Cscript setupca.vbs /uc

Install Web Pages:
Cscript setupca.vbs /iw /sr MyParentCAMachine\MyRootCA

There is also a usage that lists all the parameters if you run the script without any arguments.

 

UPDATE: Script has been updated to include option for offline requests using new /OR switch. Example:

Install Enterprise Sub CA saving request to a file:

Cscript setupca.vbs /if /sn "My Sub CA" /sp "RSA#Microsoft Software Key Storage Provider" /sk 4096 /or "c:\temp\ca.req"

Posted by shawncor | 1 Comments
Attachment(s): setupca.vbs

Official Microsoft Team Blogs / Microsoft Blogs

If you are interested in reading more official Microsoft Team blogs, see http://blogs.technet.com/blogms/pages/directory-of-microsoft-team-blogs.aspx. This page is a great collection of valuable blog information.

Posted by MS2065 | 0 Comments

Certificate Enrollment Web Services Whitepaper

The Windows Server 2008 R2 Certificate Enrollment Web Services Whitepaper has been posted to the download center: you can download it here.

This is just the initial document release for RTM.  We plan to publish the content to various Technet locations in the next several months, and we will have some opportunity to revise or update the content as part of that process.

Topics covered in the paper:

Business Scenarios
Renewal only mode description
Designing the infrastructure
-Network and Firewall requirements
-Delegation requirements
-Performance and throughput
-Client Behavior / Load Balancing
Deployment
-Installation Prerequisites
-Supported configurations
-Setup Step-By-Step
Troubleshooting and Diagnostics

Please let me know if you have questions/feedback: jfield@microsoft.com

Posted by JField | 0 Comments

How to get request statistics by template in PowerShell

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.

Active Directory Certificate Services Features by SKU

We’ve had many requests for what services and features are available in what Windows Server version and SKU.   The table below is our attempt to answer those questions.

SKU Table (NOTE: entire table describes what is available in an Enterprise CA, not a Standalone CA, installed on each Windows version; * means the feature or support is new in Windows Server 2008 R2)

Windows Server version and SKU

Role Services Available

Certificate Templates available

Auto-enrollment & Key Archival (comes with V2 Templates)

CA Features: SMTP Exit Module & Role Separation

Cross-forest Enrollment (over DCOM protocol)

Windows Web Server 2008 R2

None

NA

NA

NA

NA

Windows Server 2008 R2 Standard or Foundation

-Certification Authority (CA)

-CA Web Enrollment

-Certificate Enrollment Web Services* (policy service and enrollment service)

V1, V2*, and V3* templates

Yes*

No

No

Windows Server 2008 R2 Standard or Foundation / Server Core installation

-Certification Authority (CA)*

V1, V2*, and V3* templates

Yes*

No

No

Windows Server 2008 R2 Enterprise or Datacenter

-Certification Authority (CA)

-CA Web Enrollment

-Certificate Enrollment Web Services* (policy service and enrollment service)

-Online Responder (OCSP)

-Network Device Enrollment Service (NDES)

V1, V2, and V3 templates

Yes

Yes

Yes

Windows Server 2008 R2 Enterprise or Datacenter / Server Core installation

-Certification Authority (CA)*

V1, V2, and V3 templates

Yes

Yes

Yes

Windows Server 2008 Standard Edition

-Certification Authority (CA)

-CA Web Enrollment

V1 only

No

No

No

Windows Server 2008 Enterprise or Datacenter Edition

-Certification Authority (CA)

-CA Web Enrollment

-Online Responder (OCSP)

-Network Device Enrollment Service (NDES)

V1, V2, and V3 templates

Yes

Yes

No

Windows Server 2003 Standard Edition

-Certification Authority (CA)

-CA Web Enrollment

V1 only

No

No

No

Windows Server 2003 Enterprise or Datacenter Edition

-Certification Authority (CA)

-CA Web Enrollment

(NDES available as “MSCEP” via resource kit)

V1 and V2 templates

Yes

Yes

No

Posted by JField | 0 Comments
More Posts Next page »
 
Page view tracker