Introduction

As a BizTalk administrator, you need to know about any issues in your BizTalk environment. It is crucial to know about these issues before they become real problems or cause any unnecessary outage for any integration services provided by your BizTalk server.

Send any BizTalk alerts to specific email using a built-in Windows Task Scheduler - Routeget Architecture Framework
Strategic Enterprise Architecture: Send any BizTalk alerts to specific email using a built-in Windows Task Scheduler

In this article I will demonstrate an easy way to send alerts in case there are any errors or warnings in the BizTalk environment.

Problem Statement

You may have some customers connecting to your integration middleware through receive adapters, such as POP3, SFTP, FTP, File, etc. In some cases you may get some warnings and errors which affect these receive adapters and make them disabled once the error threshold is exceeded.

Send any BizTalk alerts to specific email using a built-in Windows Task Scheduler - Routeget Architecture Framework
Process Optimization & Governance Framework: Send any BizTalk alerts to specific email using a built-in Windows Task Scheduler

In many instances, you would not be able to use the BizTalk Administration Console for alerting as these entries do not even register in the BizTalk Message Box.

Therefore, it is very important to be notified before the end users prompted with warning or error messages when they are trying to upload into integration middleware. It is equally important to take a proactive approach to resolve any upcoming issues you might be experiencing with your BizTalk server.

Solution

You might be attempted to use monitoring tools like SCOM

Jump

or

BizTalk360

Jump

,… These tools are not free and some companies might find them costly to license and implement.

If your project does not have a budget to deploy these motioning tools, there is an easy way to get BizTalk alerts by using a combination of PowerShell scripting and the built-in Windows Task Scheduler through the following steps:

"/q:*[System [(EventID=5740)]]"

$emailSmtpUser="yourusername@gmail.com"

$emailSmtpPass="yourpassword"

$emailFrom="fromusername@gmail.com"

$emailTo="sendtousername@gmail.com"

$emailMessage=New-Object System.Net.Mail.MailMessage( $emailFrom , $emailTo )

$emailMessage.Subject="BizTalk Error"

$emailMessage.IsBodyHtml=$true

$emailMessage.Body=@"

There is a BizTalk issue

Check the attachment

"@

$emailAttachment=New-Object System.Net.Mail.Attachment("C:\SendEmail\temp\logs.txt")

$emailMessage.Attachments.Add($emailAttachment)

$SMTPClient=New-Object System.Net.Mail.SmtpClient( $emailSmtpServer , $emailSmtpServerPort )

$SMTPClient.EnableSsl=$true

$SMTPClient.Credentials=New-Object System.Net.NetworkCredential( $emailSmtpUser , $emailSmtpPass );

  1. Select Windows Start Button ->Control Panel->Administrative Tools -> Task Scheduler as shown in Figure 1 or use the shortcut command in run window control schedtasksFigure 1. Accessing Task Scheduler
  2. In Task Scheduler window, select Microsoft folder->click on create task -> in General Tab Name the task as shown in Figure 2Figure 2. Create Task
  3. Select Trigger Tab->Click New button-> in the Begin the task select on an event ->select custom->click New Event  Filter button-> in Event Sources select BizTalk -> In case you want to filter by using event id you can set an event id as shown in Figure 3Figure 3. Create Trigger
  4. Select Action Tab->Click New Button->In Action select Send an e-mail->set email settings properties as shown in Figure 4Figure 4.  Create Exchange Email Action
  5. /f:text /rd:true /c:1> C:\SendEmail\temp\logs.txt
  6. Save command into cmd file and rename it into path C:\SendEmail\WriteLog.cmd
  7. Create new action -> In Action field, select start a program-> Set Program/Script Path as shown in Figure 5Figure 5. Create Command Action
  8. Sort action and make sure that running the command action in the first action as shown in Figure 6Figure 6. Sort actions
  9. $SMTPClient.Send( $emailMessage )
  10. Figure 7. Files inside SendEmail Folders
  11. Figure 8. Edit Action to use PowerShell script
  12. To test your work, create pop3 receive location and set a wrong username and password

Intelligent Automation & Enterprise AI Governance

Deploying advanced cognitive automation and intelligent algorithmic systems across enterprise operations demands a disciplined equilibrium between automated efficiency and institutional accountability across every departmental touchpoint. Organizations advancing automation maturity must first establish the integrity, security, and traceability of underlying operational data pipelines before deploying autonomous execution engines into mission-critical workflows. Instituting explicit ethical guidelines, human-in-the-loop exception checkpoints, and granular audit logging frameworks ensures automated system outputs remain thoroughly transparent, verifiable, and compliant with evolving international regulatory mandates. Without standardized data engineering foundations, automation initiatives inevitably risk accelerating legacy operational inconsistencies across interconnected business units.

Sustainable automation scale demands a centralized center of excellence that seamlessly integrates systems engineering with frontline business domain expertise throughout project lifecycles. By maintaining continuous visibility into cycle times, operational throughput, and process exception rates, management teams can systematically prioritize high-value business processes for iterative architectural optimization. Concurrently investing in human-centric change enablement and structured workforce upskilling empowers personnel to transition from mechanical administrative routines to high-impact strategic advisory responsibilities. This collaborative operating philosophy ensures enterprise automation delivers sustainable productivity gains, enhanced auditability, and measurable competitive differentiation.

Recommended Posts

No comment yet, add your voice below!


Add a Comment

Your email address will not be published. Required fields are marked *