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:
Sample 'dayreport.bat':
The sample file 'dayreport.bat' contains:
|
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.
|
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. |
Microsoft Word Reports cannot be generated in this way.
|
Unfortunately, Microsoft Word reports cannot be generated when no user is logged on. This is the case when report tool ist 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. |