JobQueueCheck.ps1 is a PowerShell script that checks the Job Queue Entry table in one or more Business Central databases. It collects the entries with status 0, builds a small HTML report and can optionally send it by email.
- PowerShell (Windows PowerShell or PowerShell 7)
- Access to the SQL server(s) hosting your Business Central databases
- Basic familiarity with PowerShell and SQL
Edit JobQueueCheck.ps1 and adjust these variables:
$SqlServer,$SqlUser,$SqlPassword– connection details for the SQL server$TableGuid– table GUID used for BC15 and BC23 (adjust if necessary)$selectColumns– columns fromJob Queue Entrythat should appear in the output$linkedServers– list of servers/databases/companies to query
Example entry for $linkedServers:
$linkedServers = @(
@{Server='sql-01'; DB='Live'; Company='Meine GmbH & Co_ KG'; Version=1 ; Country='DE'}
#@{Server='sql-02'; DB='BC__ES'; Company='MyCompany_ES'; Version=1 ; Country='ES'},
)Run the script in PowerShell:
powershell -ExecutionPolicy Bypass -File JobQueueCheck.ps1For each configured server the script performs the following steps:
- Query
Job Queue Entryfor entries with status0. - Collect the rows into an ordered list.
- Build an HTML table (including optional country flags).
- Open the report in a browser for review.
If mail settings are supplied ($smtpServer, $smtpUser, etc.), the HTML report is also sent via Send-MailMessage.
- Modify
$selectColumnsto display additional columns. - Adjust the CSS block inside the script to change the look of the report.
- Update the
Get-FlagFromCountryorGet-FlagImageFromCountryhelpers if you prefer different country indicators.
This repository only contains the script and this README. Use the script as a starting point for your own monitoring or automation tasks.