Active Directory Certificate Services SMTP Exit Module for Windows Server 2008 R2 Example

Active Directory Certificate Services SMTP Exit Module for Windows Server 2008 R2 Example

The following is a Windows Server 2008 and Windows Server 2008 R2 version of the SMTP Exit Module posted at
http://technet.microsoft.com/en-us/library/cc773129(WS.10).aspx

Sample Configuration Batch File

The following batch file can be used as a sample to configure the SMTP exit module capabilities of the CA without editing the registry directly. The SMTP exit module can use various values stored in the CA database. BodyArg is a list of database columns to be defined and later called by variable names such as %%1, %%2, and so on. Variables must be called in sequential order as they are defined.

ImportantImportant
Before using the batch file below, ensure that you make appropriate replacements:
  • <ExchangeServerNameOrIP> with the actual name or IP address of the Exchange Server you want to use.
  • <EmailAddress> with the administrative email address you want to use for sent from and send to.
  • <SMTPAccount> with the user account that you want to use for SMTP authentication
  • <Password> with the actual password of the SMTP account you want to use for authentication
  • Do not remove any of the quotes you see in the batch file. If you don't require a line, then use REM or : to comment that line out.
  • Always test the script on a non-production replica of your network environment before trying on a production system.
  • The following line certutil -setsmtpinfo -p "<smtpaccount>" <password> has been remarked out. Clear the REM and replace with the appropriate account name and password, if you need that authentication.

The following text can be used in a batch file to configure the SMTP exit module options on a CA:

REM =================Begin Batch File ==================
@echo off

set emailfrom="<EmailAddress"
set emailto="<EmailAddress>"

:Setup_SMTP_Server // Section for setting the name of the exchange server to be used and type of authentication to be used. 1 means to use NTLM, 2 means to user Kerberos, 0 is for Basic authentication
certutil -setreg exit\smtp\SMTPServer "<ExchangeServerNameOrIP>"
certutil -setreg exit\smtp\SMTPAuthenticate 0
REM If you need to authenticate to the above SMTP server, set the Username (in quotes) and the password to authenticate with
REM certutil -setsmtpinfo -p <password> "<smtpaccount>"

:Setup_CA_For_Exit_Module // Section for turning events on or off. In this case, on.
certutil -setreg exit\smtp\eventfilter +EXITEVENT_CRLISSUED
certutil -setreg exit\smtp\eventfilter +EXITEVENT_CERTDENIED
certutil -setreg exit\smtp\eventfilter +EXITEVENT_CERTISSUED
certutil -setreg exit\smtp\eventfilter +EXITEVENT_CERTPENDING
certutil -setreg exit\smtp\eventfilter +EXITEVENT_CERTUNREVOKED
certutil -setreg exit\smtp\eventfilter +EXITEVENT_CERTRETRIEVEPENDING
certutil -setreg exit\smtp\eventfilter +EXITEVENT_CERTREVOKED
certutil -setreg exit\smtp\eventfilter +EXITEVENT_SHUTDOWN
certutil -setreg exit\smtp\eventfilter +EXITEVENT_STARTUP

:CrlIssued // Section for setting CRLIssued parameters.
certutil -setreg exit\smtp\CRLissued\To %emailto%
certutil -setreg exit\smtp\CRLissued\From %emailfrom%

:Denied // Section for setting Denied parameters
certutil -setreg exit\smtp\templates\default\Denied\From %emailfrom%
certutil -setreg exit\smtp\templates\default\Denied\To %emailto%

:Certificate_Issued // Section for setting Issued parameters.
certutil -setreg exit\smtp\templates\default\Issued\From %emailfrom%
certutil -setreg exit\smtp\templates\default\Issued\To %emailto%

:Certificate_Pending // Section for setting Pending parameters.
Certutil -setreg exit\smtp\templates\default\Pending\To %emailto%
certutil -setreg exit\smtp\templates\default\Pending\From %emailfrom%

:Certificate_Revoked // Section for setting Revoked parameters.
certutil -setreg exit\smtp\templates\default\Revoked\From %emailfrom%
certutil -setreg exit\smtp\templates\default\Revoked\To %emailto%

:Certificate_Revoked // Section for setting UnRevoked parameters.
certutil -setreg exit\smtp\templates\default\unRevoked\From %emailfrom%
certutil -setreg exit\smtp\templates\default\unRevoked\To %emailto%

:Certificate_Revoked // Section for setting Retrieve Pending parameters.
certutil -setreg exit\smtp\templates\default\retrievepending\From %emailfrom%
certutil -setreg exit\smtp\templates\default\retrievepending\To %emailto%

:Certificate_Authority_Shutdown // Section for setting Shutdown parameters.
certutil -setreg exit\smtp\Shutdown\To %emailto%
certutil -setreg exit\smtp\Shutdown\From %emailfrom%

:Certificate_Authority_Startup // Section for setting Startup parameters.
certutil -setreg exit\smtp\Startup\To %emailto%
certutil -setreg exit\smtp\Startup\From %emailfrom%

net stop certsvc & net start certsvc
echo Certificate Services SMTP Exit module has now been configured.
pause
REM ============ End Batch File ===============

Sort by: Published Date | Most Recent | Most Useful
Comments
  • Add this in case you use SSL :

    certutil -setreg exit\smtp\schemas.microsoft.com/.../smtpusessl 1

    Add this in case you use another port to connect to your SMTP Server:

    certutil -setreg exit\smtp\schemas.microsoft.com/.../smtpserverport 465

    certutil -setreg exit\smtp\schemas.microsoft.com/.../sendusing 2

  • !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\FXML-LoginDemo.jar

    !   The system cannot find the file specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\samples_readme.txt

    !   The system cannot find the file specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\SwingInterop.jar

    !   The system cannot find the file specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\src\SwingInterop\build.xml

    !   The system cannot find the path specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\src\SwingInterop\manifest.mf

    !   The system cannot find the path specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\src\SwingInterop\src\swinginterop\SampleTableModel.java

    !   The system cannot find the path specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\src\SwingInterop\src\swinginterop\SwingInterop.java

    !   The system cannot find the path specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\src\SwingInterop\nbproject\build-impl.xml

    !   The system cannot find the path specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\src\SwingInterop\nbproject\genfiles.properties

    !   The system cannot find the path specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\src\SwingInterop\nbproject\project.properties

    !   The system cannot find the path specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\src\SwingInterop\nbproject\project.xml

    !   The system cannot find the path specified.

    !   G:\Java\javafx_samples-2_2_45-windows.exe: Cannot open G:\Java\javafx_samples-2_2_45-windows\javafx-samples-2.2.45\src\FXML-Login