Home >  User Guide - UPLINX Report Tool > Generating Reports from the Command Line for Scripting and Scheduling > Example 4 - Generate Scheduled Reports

  Example 4 - Generate Scheduled Reports





Windows Task Scheduler can be used to run scripts which automate Report Tool. This provides flexibility to generate multiple reports, compare them and send out emails or publish reports to shared folders or web servers.

The following Windows batch script 'dayreport.bat' serves as a sample to be modified to your needs. It is installed by default and located in the Report Tool folder. It creates a CUCM report with the report name set to ‘CUCM_Report_’ followed by a timestamp, for example ‘CUCM_Report_20131007.doc ‘. The timestamp format is yyyymmdd, where yyyy is year, mm is month and dd is day.

The batch script can be run from a Windows command prompt and also by the Windows Tasks Scheduler to automatically generate reports at scheduled times. To generate a scheduled report generation, perform the following two steps:

1.Create a Script File (BAT) that contains the correct ReportTool.exe command line parameters and the logic you wish to execute (for example copying output to a web server or sending an email upon completion). Test this script from the command line to verify functionality. The sample script can be run by typing 'dayreport.bat' on the command prompt of Windows.

2.Create an Entry in the Windows Task Scheduler  to execute the script at scheduled times.

Sample 'dayreport.bat':

Step 1: Create a Script File

The sample file 'dayreport.bat' contains:

REM Example bat file that creates reportnames in the format CUCM_Report_20131007.html or .doc or .chm
REM Please note - any settings not available or not set in this script will be taken from the specified Report Tool Profile - as there is no profile used here
REM the default profile is used
REM *** MUST DO: Default profile is used(Start GUI, set server details in Default profile and test connectivity.)
REM *** MUST DO: No timestamp option in profile (Start GUI, tick No timestamp,close application)
REM Disable Word, CHM, Excel generation unless required
REM For a more comprehensive CUCM generation script, please see cucmreport.bat
set timestamp=%date:~-4,4%%date:~-7,2%%date:~-10,2%
echo timestamp=%timestamp%
REM Example CUCM Report
ReportTool.exe /cucm_report CUCM_Report_%timestamp%

REM Example Provisioned User Report
ReportTool.exe /cucm_provuser_report CUCM_ProvisionedUser_Report_%timestamp%

REM Example IMP/CUPS User Report
ReportTool.exe /cups_report CUPS_Report_%timestamp%
REM Example Unity Connection Report
ReportTool.exe /cuc_report CUC_Report_%timestamp%

REM Example Emergency Responder Report
ReportTool.exe /cer_report CER_Report_%timestamp%

REM Example Unified Contact Centre Express Report
ReportTool.exe /uccx_report UCCX_Report_%timestamp%
REM Example C-Server or UCS Manager Report
ReportTool.exe /ucs_report UCS_Report_%timestamp%
REM Example VMware Server Report
ReportTool.exe /vm_report VM_Report_%timestamp%

REM Example Expressway Server Report
ReportTool.exe /cew_report CEW_Report_%timestamp%
REM Example CUCM Licensing Report
ReportTool.exe /cucm_licensing CUCM_Licensing_Report_%timestamp%

REM Example Phone Inventory Report
ReportTool.exe /inventory Phone_Inventory_Report_%timestamp%


For the above script to work, you must first start Report Tool in GUI mode, then set the server details and test connectivity. The drop down box on the top of Report Tool should show 'Profile: Default'. Alternatively, you can specify the IP address and logon details of each server on the command line.

Step 2: Run as Windows Task

The Windows Task Scheduler can be started in Settings > Control Panel > Administrative Tools > Task Scheduler.

To create a new scheduled task, you can use the wizard “Create Task”. Select 'dayreport.bat' and specify a trigger to define the execution time(s). Select “C:\Program Files (x86)\ReportTool\dayreport.bat" for the program to execute or your own script program that you have tested to run successfully in the first step.

Choosing ReportTool.exe as the program to execute is not recommended. 

Run UPLINX Report Tool from a Task of Windows Task Scheduler

Windows Task Scheduler will execute the script in the security context of the configured user account (marked with the red box above). If there are issues when running as a scheduled task, please check the user’s security privileges and configure the user for ‘enable interactive login’.

Run the Windows Task under the same Account Name (user) as in interactive mode . The license is per node and per user. Hence, running it under a different user might print 'not licensed' into each 3rd record of a report.


Unfortunately, Microsoft Word reports cannot be generated when no user is logged on. This is the case when report tool is run from Windows Task Scheduler.

This is a limitation of Microsoft Word. For more details, please see https://support.microsoft.com/en-us/kb/257757



Do you need a professional solution for change management on CUCM?

Check out our product Track and Audit Configurations or contact us.





Copyright © 2024 UPLINX - Last updated 26 Feb 2024