We are encountering an issue in BizTalk server 2016, where a few running SFTP receive locations would stop after some time due to connectivity issues of their threshold. Therefore, I would like to share a PowerShell script to enable the receive location through Windows Task Scheduler.
Before executing the following script, please complete the following tasks: a. Set the server name in the ConnectionString. b. Set the value of ($hostname) to the host name used in the SFTP receive location. c. Set the value of ($rcvLocation) to the receive location name.
# Import external assembly and create a new object
#Restart-Service -Displayname “BizTalk Service BizTalk Group : ${hostname}”
#Enable receive location
enableReceiveLocation
#Wait for few seconds
Start-Sleep-s30
}
Please keep in mind that the script above allows you to enable a single receive location for SFTP. However, you can set up multiple SFTP receive locations by repeating the same steps for each location in BizTalk.
Note that you need to use the BizTalk Admin Group user to create a Window Task Scheduler, and if the BizTalkMgmtDb database runs under a different user, please provide the username and password in the ConnectionString.