# Start of script $MURegData = Get-ItemProperty -Path "hklm:\\Software\Exclaimer Ltd\Exclaimer" [string]$ReplayPath=Get-TransportServer | Select-Object -Property ReplayDirectoryPath $ReplayPath=$ReplayPath.Substring(22,$ReplayPath.Length-23) $dllpath=$MURegData.ControlFilePath+"ExclaimerAdaptorExchange2007.dll" Install-TransportAgent -Name "ExclaimerSmtpAgent" -TransportAgentFactory "ExclaimerAdaptorExchange2007.ExclaimerSmtpAgentFactory" -AssemblyPath $dllpath Install-TransportAgent -Name "ExclaimerRoutingAgent" -TransportAgentFactory "ExclaimerAdaptorExchange2007.ExclaimerRoutingAgentFactory" -AssemblyPath $dllpath Enable-TransportAgent -Identity ExclaimerSmtpAgent Enable-TransportAgent -Identity ExclaimerRoutingAgent Restart-Service "MSExchangeTransport" Set-ItemProperty -Path "hklm:\\Software\Exclaimer Ltd\Exclaimer" -Name "ReplayPath" -Value $ReplayPath Get-TransportAgent #End of script