Synergy Background Jobs

Here is the code to build the standard Synergy Background jobs in SQL Management Studio:

use [master]
DECLARE @Server varchar(50)
DECLARE @DBCONFIG varchar(50)
DECLARE @BaseURL varchar (50)
DECLARE @Location varchar (100)
DECLARE @TempDrive varchar (50)
DECLARE @Exchangesrv varchar (50)
DECLARE @Login varchar (50)
DECLARE @Job varchar(250)
DECLARE @Temp varchar (250)

SET @Server = ‘[ServerName]’      — Name of the SQL server where the database is located  e.g. ‘SERVER1’
SET @DBCONFIG = ‘[Database Name]’ — Name of the virtual directory e.g. ‘SYNERGY’
SET @BaseURL = ‘Synergy url’      — URL to access the local environment (portal)  e.g. ‘http://SERVER1/empportal’
SET @Location = ‘C:\Synergy’      — Local path to the Synergy installation  e.g. ‘”D:\Synergy’ , Do not add the last slash
SET @TempDrive = ‘c:\temp\’         — Local path to location for temporary files.  e.g. ‘E:\Temp’
SET @Exchangesrv = ”                       — Name of the Exchange 2000 server. Leave blank if there is no Exchange server”
SET @Login = ‘[login name]’           — The Windows user name should be equal to the userid in Exact Synergy Enterprise. Owner of the job. e.g. ‘Domain\user’

–Exact.WordIndex (Requests)
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.WordIndex (Requests)’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.WordIndex /CLASS:IndexRequests /TimeStampSetting:FulltextRequests /Selection:0’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Updates the index tables in order to make use of the Enterprise search mechanism (requests)’, @enabled = 0, @owner_login_name =  @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 000000  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.WordIndex (Documents)
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.WordIndex (Documents)’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.WordIndex /CLASS:IndexDocuments /TimeStampSetting:FulltextDocuments /Selection:0’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Updates the index tables in order to make use of the Enterprise search mechanism (documents)’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 001500  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.WordIndex (Attachments)
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.WordIndex (Attachments)’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.WordIndex /CLASS:IndexAttachments /TimeStampSetting:FulltextAttachments /Selection:0’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Updates the index tables in order to make use of the Enterprise search mechanism (attachments)’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 003000  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.WordIndex (Do You Mean Requests)
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.WordIndex (DYM Requests)’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.WordIndex /CLASS:IndexRequests /UpdateCounts:1’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Background job to optimize the full text backgroundprocess and Do you mean functionality (requests)’, @enabled = 0, @owner_login_name =  @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 004500  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.WordIndex (Do You Mean Documents)
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.WordIndex (DYM Documents)’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.WordIndex /CLASS:IndexDocuments /UpdateCounts:1’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Background job to optimize the full text backgroundprocess and Do you mean functionality (documents)’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 010000  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.WordIndex (Do You Mean Attachments)
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.WordIndex (DYM Attachments)’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.WordIndex /CLASS:IndexAttachments /UpdateCounts:1’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Background job to optimize the full text backgroundprocess and Do you mean functionality (attachments)’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 011500  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.SysExchange
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.SysExchange’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.SysExchange /CLASS:SysExchange /E:’ + @Exchangesrv

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘This background job is to synchronized the appointment between Microsoft Outlook and Synergy Enterprise Calendar.’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 013000  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.SysHrMail
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.SysHrMail’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.SysHrMail /CLASS:SysHrMail /BR:’ + @Location + ‘”‘

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Send out e-mails for mail merge purposes; Merge and create request; CRM/ Logistic batch update; Clean up of Not validated accounts; and Export HRM, CRM and Financial report in Excel sheet’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 014500  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.SysMaint
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.SysMaint’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.SysMaint /CLASS:SysMaint /S:’ + @Server + ‘ /NT’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘This background job is to updates status of employees from Hired to Active, and Active to Inactive based on start dates and exit dates; Creates NT accounts for new employee, inform manager/ account manager (of resellers) on user account and password through Task; Creates Documents for manager of new employee, informing the new ID; Deletes NT accounts for inactive persons; Updates absence field in Humres table to indicate whether the person is in/ out of office for the day’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 020000  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.CRM (Accountstatus)
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.CRM (Accountstatus)’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.CRM /CLASS:AccountStatus’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Validates and checks account statuses (non-validated, prospects and customers) based on sales forecasts and contracts.’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 021500  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.CRM (AccountRating)
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.CRM (AccountRating)’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.CRM /CLASS:AccountRating’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Evaluates Accounts ratings based on their contract value (for customers and resellers only).’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 023000  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.Documents
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.Documents’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.Documents /CLASS:DocScheduler’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Recalculates all document counts which are displayed when using the “Category” view of e-Documents. This parameter also removes the “New” indication in that same overview. Calculate of all existing document references for pictures. This parameter is also executed when the /C:Picture parameter is added, but only if the BDPictureFilled = N. Removes all the expired documents based on the expiry date set for those documents. Removes all pictures in the database that are not used by any document. Updates the versions of the documents. When a version is added for a specific document this parameter will make sure the new version is set to “active”
‘, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 024500  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.SysLogTool
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.SysLogTool’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.SysLogTool /CLASS:SysLogTool’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘This background job reduces the size of the database by deleting the old log entries at \System \Report \Log \Processes.’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 030000  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.ConProcess
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.ConProcess’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.ConProcess /CLASS:ConProcess’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Contract processing’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 031500  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.FinExchange
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.FinExchange’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.FinExchange /CLASS:FinExchange /C:’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Automatic import of financial entries’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 033000  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.FinCheck
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.FinCheck’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.FinCheck /CLASS:FinCheck /C:’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Compare financial figures with Globe administration’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 034500  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.FinPending
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.FinPending’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.FinPending /CLASS:FinPending /C:’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Validation of imported financial transactions’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 040000  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

–Exact.Jobs.FinExcel
SET @Job = ‘(‘ + LEFT(@DBCONFIG, 100) + ‘)’ + ‘ Exact.Jobs.FinExcel’
SET @Temp = @Location + ‘\bin\Exact.Process.exe” /DBCONFIG:’ + @DBCONFIG + ‘ /ASSEMBLY:Exact.Jobs.FinExcel /CLASS:FinExcel’

EXEC msdb..sp_add_job @job_name = @Job, @description = ‘Import transactions via Excel sheets’, @enabled = 0, @owner_login_name = @Login
EXEC msdb..sp_add_jobstep @job_name = @Job, @step_name = ‘Step1’, @subsystem = ‘CMDEXEC’, @command = @Temp
EXEC msdb..sp_add_jobschedule @job_name = @Job, @name = ‘ImportSchedule’, @freq_type = 4, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 30, @active_start_time = 041500  
EXEC msdb..sp_add_jobserver @job_name = @Job, @server_name = ‘(local)’

PlusPoint Bullet