Certificate Enrollment for System Center Operations Manager Agent
This article describes process of obtaqining and installing a digital certificate for OpsMgr agent that is not a member of your AD forest or a trusted forest. This article assumes that your managed computer is running one of the following operating systems:
- Windows 2000
- Windows XP
- Windows Vista
- Windows 7
- Windows 8/8.1
- Windows 10
- Windows 2000 Server
- Windows Server 2003 (including R2)
- Windows Server 2008 (including R2 and Server Core)
- Windows Server 2012 (including R2 and Server Core)
Target audience is OpsMgr administrators that have limited or no understanding of what certificates are and how PKI works. Described below is not the only way to achieve the same or similar goal but it implements many of PKI Best Practices.
In this article
-
All steps described in this section must be completed in both scenarios
Scenario 1 Certification Authority server is configured as Standalone CA and running one of the following operating systems: Windows Server 2003/2003 R2/2008/2008 R2 Standard, Enterprise or Datacenter edition.
-
Certification Authority server is configured as Enterprise CA and running one of the following operating systems: Windows Server 2003/2003 R2/2008/2008 R2.
- Prepare certificate template
- Add new template to Issuing Enterprise CA
- Prepare certificate request template
- Create a request file to use with an Enterprise CA
- Submit a request file to Enterprise Cetrtification Authority
- Install issued certificate to managed computer
- Import certificates using MOMCertImport
Prerequisites
Note: all steps described in Prerequistes section must be completed in both scenarios.
Existing Certification Authority (CA)
We suppose you already have some version of Microsoft Windows Server Active Directory Certificate Services (AD CS) Certificate Authority (CA) deployed in your environment and your OpsMgr Management Servers already trust this CA. You could also use commercial certificates issued by a third-party CA but in this case some of the steps described below shoud be a little bit different.
Export Certificates of CA Hierarchy
First you need to export your CA hierarchy certificates.
- Log on to the computer that acts as Issuing CA with CA administrator permissions.
- On the Windows desktop, click Start, click Administrative Tools and click Certification Authority. If User Account Control is enabled, enter required account credentials or just click Yes on consent window.
- In the Certification Authority window select certification authority name, click Action and then click Properties.
- In the Certification Authority Properties window click View Certificate button.
- In the Certificate properties window switch to Details tab and click Copy to file… button.
- In the Welcome to the Certificate Export Wizard click Next button.
- In the Export file format window select the following options:
Cryptographic Message Syntax Standard — PKCS #7 Certificates,
Select Include all certificates in the certification path if possible
and click Next button.
- In the File to export window specify path and file name for certificate chain, for example, TrustedCA.p7b, and click Next button.
- In the Completing the Certificate Export Wizard window review your export settings. If these are correct, click Finish button.
- If export is successfull you will see success confirmation pop-up window. Close it by pressing Ok button and close Certification Authority snap-in.
Distribute Certificates of CA Hierarchy
Now you need to transfer the above file to each of managed computers and import it as described below.
- Log on to the managed computer with local Adminsitrator priveleges.
- On the Windows desktop, click Start, and then click Run.
- In the Run dialog box, type mmc, and then click OK. If User Account Control is enabled, enter local Administrator password or just press Yes on consent window.
- In the Console1 window, click File, and then click Add/Remove Snap-in.
- In the Add/Remove Snap-in dialog box, click Add.
- In the Add Standalone Snap-in dialog box, click Certificates, and then click Add.
- In the Certificates snap-in dialog box, select Computer account, and then click Next.
- In the Select Computer dialog box, ensure that Local computer: (the computer this console is running on) is selected, and then click Finish.
- In the Add Standalone Snap-in dialog box, click Close.
- In the Add/Remove Snap-in dialog box, click OK.
- In the Console1 window, expand Certificates (Local Computer), expand Trusted Root Certification Authorities, and then click Certificates.
- Right-click Certificates, select All Tasks, and then click Import.
- In the Certificate Import Wizard, click Next.
- On the File to Import page, click Browse and select the location where you downloaded the CA certificates file, for example, TrustedCA.p7b, select the file, and then click Open.
- On the File to Import page, select Place all certificates in the following store and ensure that Trusted Root Certification Authorities appears in the Certificate store box, and then click Next.
- On the Completing the Certificate Import Wizard page, click Finish.
- Close MMC console window.
Scenario 1
Certification Authority server is configured as Standalone CA and running one of the following operating systems: Windows Server 2003/2003 R2/2008/2008 R2 Standard, Enterprise or Datacenter edition.
Prepare certificate request template
- Log on to the managed comuter with local Administrator privileges.
- Click Start, and then click All Programs, Accessories, and then click Notepad.
- Paste the following into the notepad window:
[NewRequest]
Subject="CN=<FQDN of managed computer>"
KeyLength=2048
KeySpec=1
KeyUsage=0xf0
MachineKeySet=TRUE
[EnhancedKeyUsageExtension]
OID=1.3.6.1.5.5.7.3.1
OID=1.3.6.1.5.5.7.3.2
Note: You should enter the FQDN name of your managed computer into the second line after “=” sign. For non-domain computers, FQDN equals NetBIOS name. Example: Subject="CN=MyWorkGroupPC".
Save the file with an .inf file name extension, for example OpsMgrConfig.inf.
Note: It is a common mistake to create the file in Notepad and save the file as OpsMgrConfig.inf.txt. To prevent this, change the file type to All Files from the default of Text Documents (*.txt).
Close Notepad.
Create a request file to use with an Standalone Certification Authority
Click Start, click All Programs, Accessories and then click Command Prompt.
Note: If User Account Control is enabled run Command Prompt window by choosing Run as Administrator command from the shortcut’s context menu. If prompted enter local Administrator password or just press Yes on consent prompt.
In the Command Prompt window run the following command:
CertReq -New -f path\OpsMgrConfig.inf path\OpsMgr_%computername%.req
Note: you should enter a valid path for INF and REQ files. Request file should not exist yet when you run the command. It is created when you run the command.
- Type Exit in Command Prompt window and press Enter.
- Locate created OpsMgr_%computername%.req file and transfer it back to your Certification Authority.
Submit a request file to Standalone Cetrtification Authority
Log on to the computer that acts as a Issuing Standalone Certification Authority with Certification Authority administrator or Certification Authority manager priveleges.
On the Windows desktop, click Start, Administrative Tools and click Certification Authority. If User Account Control is enabled, enter required account password or just click Yes on consent window.
In the Certification Authority window select certification authority name, click Action, click All Tasks and then click Submit a new request.
In the Open request file window locate request file and click Open.
Note: The request file is the one with .REQ file name extension you prepared on the pervious step.
Now this request is waiting for approval. In the same console expand your CA name and select Pending Requests. Locate the request you submitted (typically it should be the only pending request). Click Action, All Tasks and click Issue.
If request is issued Save Certificate window will appear. Save certificate to a file, for example ManagedComputerName_cert.cer file.
Close Certification Authority snap-in.
Transfer this file back to the managed computer.
Install issued certificate to managed computer
Log on to the managed comuter with local Administrator permissions.
Click Start, click All Programs, Accessories and then click Command Prompt.
Note: If User Account Control is enabled run Command Prompt window by choosing Run as Administrator command from the shortcut’s context menu. If prompted enter local Administrator password or just press Yes on consent prompt.
In the Command Prompt window run the following command:
Certreq -accept path\%computername%_cert.cer
Note: you should enter a valid path for the certificate file.
If no error are displayed in CMD window proceed to the next step.
Import certificates using MOMCertImport
At the command prompt, type <drive_letter>: (where <drive_letter> is the drive where the Operations Manager 2007 installation media is located. E.g. type “d:” without quotes), and then press ENTER.
Type cd \SupportTools\i386 and then press ENTER.
Note: On 64-bit computers, type cd \SupportTools\amd64
Run the following command:
MOMCertImport /SubjectName %computername%
If command returns successful status, type Exit to close Command Prompt window.
Scenario 2
Certification Authority server is configured as Enterprise CA and running one of the following operating systems: Windows Server 2003/2003 R2/2008/2008 R2.
Note: Windows Server 2003, Windows Server 2003 R2 and Windows Server 2008 Standard Edition don’t support version 2 templates.
Prepare certificate template
- Log on to the computer that acts as an Issuing Enterprise Certification Authority with Enterprise Admin privileges.
- On the Windows desktop
,click Start, and then click Run. - In the Run dialog box type mmc, and then click OK. If User Account Control is enabled, enter required account credentials or just click Yes on consent window.
- In the Console1 window, click File, and then click Add/Remove Snap-in.
- In the Add/Remove Snap-in dialog box, click Add.
- In the Add Standalone Snap-in dialog box, click Certificate Templates.
- In the Certificate Templates window locate the temlate named Computer.
- Click Action and then click Duplicate Template. If prompted, select Windows Server 2003, Enterprise Edition.
- In Properties of New Template window in General tab specify new template name. For example, OpsMgrAgentV2.
- Switch to Subject Name tab and select Supply in the request.
- Switch to Security tab.
- Add a custom global or universal group that contains Certification Authority managers or Certification Authority administrators, and assign the group Read and Enroll permissions.
- Click Apply and then click Ok to save changes to new template and close Certificate Templates window.
Add new template to Issuing Enterprise CA
- Log on to the computer that acts as Issuing Enterprise CA with Certification Authority administrator permissions.
- On the Windows desktop, click Start, click Administrative Tools and click Certification Authority. If User Account Control is enabled, enter required account credentials or just click Yes on consent window.
- Expand your Certification Authority name and select Certificate Templates.
- In the Certificate Templates click Action, New and Certificate template to issue.
- In the Enable Certificate Templates window locate custom template (in our example this is OpsMgrAgentV2) and click Ok.
Prepare certificate request template
- Log on to the managed comuter with local Administrator privileges.
- Click Start, and then click Run.
- In the Run dialog box, type Notepad, and then click OK.
- Paste the following into the notepad window:
[NewRequest]
Subject="CN=<FQDN of managed computer>"
KeyLength=2048
KeySpec=1
KeyUsage=0xf0
MachineKeySet=TRUE
[RequestAttributes]
CertificateTemplate="OpsMgrAgentV2"
Note: You should enter the FQDN name of your managed computer into the second line after “=” sign. For non-domain computers, FQDN equals NetBIOS name. Example: Subject="CN=MyWorkGroupPC".
Note: in CertificateTemplate field you must enter certificate template common name rather display name.
Save the file with an .inf file name extension, for example OpsMgrConfig.inf.
Note: It is a common mistake to create the file in Notepad and save the file as OpsMgrConfig.inf.txt. To prevent this, change the file type to All Files from the default of Text Documents (*.txt).
Close Notepad.
Create a request file to use with an Enterprise CA
Click Start, click All Programs, Accessories and then click Command Prompt.
Note: If User Account Control is enabled run Command Prompt window by right-clicking on CMD icon and pressing Run as Administrator. If prompted enter local Administrator password or just press Yes on consent prompt.
In the Command Prompt window run the following command:
CertReq -New -f path\OpsMgrConfig.inf path\OpsMgr_%computername%.req
Note: you should enter a valid path for INF and REQ files. Request file should not exist when you run the command.
- Type exit to close Command Prompt window.
Locate created OpsMgr_%computername%.req file and transfer it back to where you have access to your Certification Authority.
Submit a request file to Enterprise Cetrtification Authority
- Log on to the computer that acts as an Issuing Enterprise Certification Authority with Certification Authority administrator or Certification Authority manager permissions.
- On the Windows desktop, click Start, click Administrative Tools and click Certification Authority. If User Account Control is enabled, enter required account credentials or just click Yes on consent window.
- In the Certification Authority window select Certification Authority name, click Action, click All Tasks and then click Submit a new request.
- In the Open request file window locate OpsMgr_ManagedComputerName.req file and click Open.
- By default Enterprise Certification Authority immediately issue or deny supplied request.
- If request is issued Save Certificate window will appear. Save certificate to a file, for example ManagedComputerName_cert.cer file.
- Close Certification Authority snap-in.
- Transfer this file back to the managed computer.
Install issued certificate to managed computer
Log on to the managed comuter with local Administrator permissions.
Click Start, click All Programs, Accessories and then click Command Prompt.
Note: If User Account Control is enabled run Command Prompt window by choosing Run as Administrator command from the shortcut’s context menu. If prompted enter local Administrator password or just press Yes on consent prompt.
In the Command Prompt window run the following command:
Certreq -accept path\%computername%_cert.cer
Note: you should enter a valid path for the certificate file.
If no error are displayed in CMD window proceed to the next step.
Import certificates using MOMCertImport
Click Start, click All Programs, Accessories and then click Command Prompt.
Note: If User Account Control is enabled run Command Prompt window by choosing Run as Administrator command from the shortcut’s context menu. If prompted enter local Administrator password or just press Yes on consent prompt.
At the Command Prompt, type <drive_letter>: (where <drive_letter> is the drive where the Operations Manager 2007 installation media is located. E.g. type “d:” without quotes), and then press ENTER.
Type cd \SupportTools\i386 and then press ENTER.
Note: On 64-bit computers, type cd \SupportTools\amd64
run the following command:
MOMCertImport /SubjectName %computername%
If command returns successful status type Exit to close Command Prompt window.