======================================================================================================================================================
	CODETWO EXCHANGE RULES AND CODETWO EXCHANGE RULES PRO ON WINDOWS SERVER CORE VERSION - INSTALLATION MANUAL
======================================================================================================================================================

	This manual contains instructions for installing, updating, or uninstalling CodeTwo Exchange Rules 2019 (or newer) or CodeTwo Exchange Rules Pro
	(version 2.12 or newer) on Server Core version of Windows Server 2019 or newer without using the graphical user interface (GUI). It is recommended 
	that these instructions are carried out as described in this manual.
	
	CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro needs to be deployed on Exchange server with Mailbox server role installed. Only the basic 
	components of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro, necessary to relay emails through either of the programs, are installed on 
	Server Core:
	- CodeTwo Exchange Rules services
	- CodeTwo Exchange Rules Transport Agent
	- licensing module. 
	Other modules are not installed since they need a GUI to operate them. This means that in order to configure and manage email rules, edit program 
	settings, or use other features of the program that require GUI, you need to install the Administration Panel of CodeTwo Exchange Rules or CodeTwo 
	Exchange Rules Pro on another machine (not Core) from a standard EXE installer.
	

HOW TO INSTALL

	In order to install the CodeTwo Exchange Rules services on Windows Server Core version, perform the steps described below.

	1. Run the Command Prompt (cmd.exe).
	2. In the Command Prompt, run the appropriate .msi file of the CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro installation package with the 
		following parameters:
		 /quiet;
		 ACTION="INSTALL";
		 EXCHANGE_VERSION="<value>" - this parameter determines the version of Exchange server that is installed on your machine. The value can be, 
		  for example: 2019;
		 CORE="1" - this parameter determines a Server-Core-specific installation of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro. Setting the 
		  value to "1" will install a version of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro that is compatible with Server Core;
		 INSTALLDIR="<installation_dir_path>" – this parameter is optional. The default installation directory of CodeTwo Exchange Rules and CodeTwo 
		  Exchange Rules Pro is: C:\Program Files\CodeTwo\CodeTwo Exchange Rules. You can change the installation location by typing different path 
		  as a parameter value.
		 Example command line for installing CodeTwo Exchange Rules Pro: 
		  ExchangeRulesPro2SetupEN.msi /quiet ACTION="INSTALL" EXCHANGE_VERSION="2019" CORE="1"	
	3. In the PowerShell Console, navigate to the installation directory of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro, where the 
		InstallCodeTwoTransportAgent.ps1 script is located. This script performs the following actions:
		- stops the CodeTwo Exchange Rules and MSExchangeTransport services,
		- installs and enables the CodeTwo Exchange Rules Transport Agent,
		- starts the CodeTwo Exchange Rules and MSExchangeTransport services.
	4. Run the InstallCodeTwoTransportAgent.ps1 script to install the CodeTwo Exchange Rules Transport Agent. If for some reason you cannot run the  
		CodeTwo Exchange Rules Transport Agent installation script, you can install the transport agent manually. To do so, follow the steps described
		in section HOW TO INSTALL THE CODETWO EXCHANGE RULES TRANSPORT AGENT MANUALLY below.


VERIFYING THE INSTALLATION PROCESS: 
	
	In order to verify if the CodeTwo Exchange Rules services were installed correctly, perform the steps described below. 

	1. Launch the PowerShell Console and run the command: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
	2. Run the command: Get-Service "CodeTwo Exchange Rules*". This command should return the following services: CodeTwo Exchange Rules Attendant, 
		CodeTwo Exchange Rules Service, CodeTwo Exchange Rules Sent Items Update. Each of them should be active (Running).
	3. Run the command: Get-TransportAgent. This command returns a list of installed transport agents. You should see the CodeTwo Exchange Rules 
		Transport Agent at the bottom of the list. This transport agent should be enabled. 


HOW TO UNINSTALL
	
	In order to uninstall the CodeTwo Exchange Rules services from Windows Server Core version, perform the steps described below.
	
	1. In the PowerShell Console, navigate to the installation directory of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro, where the 
		UninstallCodeTwoTransportAgent.ps1 script is located (by default, the program is installed in: C:\Program Files\CodeTwo\CodeTwo Exchange Rules). 
		This script performs the following actions:
		- stops the CodeTwo Exchange Rules and MSExchangeTransport services,
		- uninstalls the CodeTwo Exchange Rules Transport Agent,
		- starts the CodeTwo Exchange Rules and MSExchangeTransport services.
	2. Run the UninstallCodeTwoTransportAgent.ps1 script to uninstall the CodeTwo Exchange Rules Transport Agent. If for some reason you cannot run the 
		CodeTwo Exchange Rules Transport Agent uninstallation script, you can uninstall the transport agent manually. To do so, follow the steps 
		described in section HOW TO UNINSTALL THE CODETWO EXCHANGE RULES TRANSPORT AGENT MANUALLY below.
	3. Run the Command Prompt (cmd.exe).
	4. In the Command Prompt, in order to uninstall the CodeTwo Exchange Rules services, run the appropriate .msi file of the CodeTwo Exchange Rules or 
		CodeTwo Exchange Rules Pro installation package with the following parameters:
		 /quiet;
		 REMOVE="ALL";
		 EXCHANGE_VERSION="<value>" - this parameter determines the version of Exchange server that is installed on your machine. The value can be, 
		  for example: 2019;
		 CORE="1" - this parameter determines a Server-Core-specific installation of CodeTwo Exchange or CodeTwo Exchange Rules Pro. Value "1" is used 
		  when uninstalling a version of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro that is compatible with Server Core;
		 Example command line for uninstalling CodeTwo Exchange Rules Pro:
		  ExchangeRulesPro2SetupEN.msi /quiet REMOVE="ALL" EXCHANGE_VERSION="2019" CORE="1"


VERIFYING THE UNINSTALLATION PROCESS: 

	In order to verify if the CodeTwo Exchange Rules services were uninstalled successfully, perform the steps described below.

	1. Launch the PowerShell Console and run the command: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
	2. In the PowerShell Console, run the command: Get-Service "CodeTwo Exchange Rules*". This command should not return any services.
	3. Run the command: Get-TransportAgent. This command returns a list of installed transport agents. The CodeTwo Exchange Rules Transport Agent should 
		not be listed.
	

HOW TO UPDATE 

	Before you update the program to the latest version on Windows Server Core version, you need to uninstall the existing version. Perform the steps 
	described in the section HOW TO UNINSTALL above by using the .msi file that contains the installation data of the currently deployed version of 
	CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro. Next, perform the steps described in the section HOW TO INSTALL above by using the .msi file 
	of the new version of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro.

	All settings will be retained.

	If the CodeTwo Exchange Rules services are also installed on other servers in your organization, you need to update them on each server.
	

HOW TO INSTALL THE CODETWO EXCHANGE RULES TRANSPORT AGENT MANUALLY

	If for some reason you cannot run the CodeTwo Exchange Rules Transport Agent installation script as described in section HOW TO INSTALL, you can 
	install the transport agent manually by following the steps described below.
	
	1. Launch the PowerShell Console and run the command: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
	2. Stop the MSExchangeTransport service by running the command: Stop-Service "MSExchangeTransport"
	3. Stop all the installed CodeTwo Exchange Rules services by running the command: Stop-Service "CodeTwo Exchange Rules*"
	4. In the PowerShell Console, navigate to the installation directory of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro. By default, the program 
		is installed in: C:\Program Files\CodeTwo\CodeTwo Exchange Rules. 
	5. Get an absolute path to the CodeTwo.ER.Agent.dll file by running the command: $CodeTwoAgentAssemblyPath = Resolve-Path -Path CodeTwo.ER.Agent.dll
	6. Install the CodeTwo Exchange Rules Transport Agent by running the command: 
		Install-TransportAgent -Name "CodeTwo Exchange Rules Transport Agent" -AssemblyPath $CodeTwoAgentAssemblyPath -TransportAgentFactory 
		"Agent.CAgentFactoryRouting"
	7. Enable the installed transport agent by running the command: Enable-TransportAgent -Identity "CodeTwo Exchange Rules Transport Agent"
	8. Start the MSExchangeTransport service by running the command: Start-Service "MSExchangeTransport"
	9. Start all the installed CodeTwo Exchange Rules services by running the command: Start-Service "CodeTwo Exchange Rules*"

	
HOW TO UNINSTALL THE CODETWO EXCHANGE RULES TRANSPORT AGENT MANUALLY

	If for some reason you cannot run the CodeTwo Exchange Rules Transport Agent uninstallation script as described in section HOW TO UNINSTALL, you can 
	uninstall the transport agent manually by following these steps:
	
	1. Launch the PowerShell Console and run the command: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
	2. Stop the MSExchangeTransport service by running the command: Stop-Service "MSExchangeTransport"
	3. Stop all the installed CodeTwo Exchange Rules services by running the command: Stop-Service "CodeTwo Exchange Rules*"
	4. Uninstall the CodeTwo Exchange Rules Transport Agent by running the command: 
		Uninstall-TransportAgent -Identity "CodeTwo Exchange Rules Transport Agent" -Confirm:$false
	5. Start the MSExchangeTransport service by running the command: Start-Service "MSExchangeTransport"
	6. Start all the installed CodeTwo Exchange Rules services by running the command: Start-Service "CodeTwo Exchange Rules*"


LICENSING
	
	You can check the license status or activate your CodeTwo program on Server Core version of Windows Server 2019 or newer by using a dedicated console 
	application CodeTwo.ER.Licensing.Console.exe, located in the installation folder of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro. To start 
	working with the application, run it in the Command Prompt, and the app will show information about the syntax and available parameters.
	

ACTIVATION
	
	Software activation requires a license key for your product and internet access. If you encounter any internet access issues, you can also activate your 
	program manually (via email).
	
	To activate CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro on Windows Server Core, follow the steps below.

	1. Run the Command Prompt and navigate to the installation directory of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro. By default, the program is 
		installed in: C:\Program Files\CodeTwo\CodeTwo Exchange Rules.
	2. In the Command Prompt, run the CodeTwo.ER.Licensing.Console.exe with the following parameter: 
		/activate <LIC_KEY> - this parameter activates the program with the license key (<LIC_KEY>) you provided. Important: Make sure the license key has 
		the following format: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.
		Example command line: 
		  CodeTwo.ER.Licensing.Console.exe /activate ABCD1-EFGH2-IJKL3-MNOP4-QRST5
	3. The application tells you when the activation is finished, and then restarts the CodeTwo Exchange Rules Service to complete the process. After
		successful activation, a license summary is displayed.
	
	If the activation cannot be completed, the application provides information about the probable cause. After you solve the problem, you need to repeat the 
	activation process.


MANUAL ACTIVATION 
	
	If for some reason the program cannot be activated automatically over the Internet, you can activate it manually by following the steps described below.

	1. Run the Command Prompt and navigate to the installation directory of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro. By default, the program is 
		installed in: C:\Program Files\CodeTwo\CodeTwo Exchange Rules. 
	2. In the Command Prompt, run the CodeTwo.ER.Licensing.Console.exe with the following parameter: 
		/regcode
		As a result, the registration code will be displayed.
	3. Send your license key and registration code to CodeTwo so that we register the program manually in our licensing system. You can use the form available 
		at www.codetwo.com/support/form/ to contact us. Please make sure that you include "manual activation" in the subject line and send the message from 
		a mailbox that you check on a regular basis. CodeTwo Customer Support responds within 24 hours.
	4. We will send you an activation code that will allow you to finish the manual activation.
	5. In the Command Prompt, run the CodeTwo.ER.Licensing.Console.exe with the following parameter: /manualactivate <LIC_KEY> <ACT_CODE> <LIC_NUM>. Where:
		<LIC_KEY> is your license key in the following format: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.
		<ACT_CODE> is the activation code that was sent to you by CodeTwo.
		<LIC_NUM> is the number of licenses assigned to the license key you provided.
		Example command line: 
		  CodeTwo.ER.Licensing.Console.exe /manualactivate ABCD1-EFGH2-IJKL3-MNOP4-QRST5 0ABC1DEFGH 50	
	6. The application tells you when the activation is finished, and then restarts the CodeTwo Exchange Rules Service to complete the process. After
		successful activation, a license summary is displayed.
	
	If the activation cannot be completed, the application provides information about the probable cause. After you solve the problem, you need to repeat the 
	activation process.
	
	
HOW TO GET INFORMATION ABOUT THE CURRENT LICENSE
	
	To display information about the currently used license, follow the steps below.
	
	1. Run the Command Prompt and navigate to the installation directory of CodeTwo Exchange Rules or CodeTwo Exchange Rules Pro. By default, the program is 
		installed in: C:\Program Files\CodeTwo\CodeTwo Exchange Rules.
	2. In the Command Prompt, run the following command: CodeTwo.ER.Licensing.Console.exe /info
		The application will show detailed information about the currently used license.