If you are finding that the BI4Cloud Desktop Connector Service is stopping on your server, then a simple PowerShell script can be used, along with a windows scheduled task, to automatically restart the service if it is not running.
The PowerShell script is as follows:
$serviceDisplayName = "BI for Cloud Desktop Connector Service"
if ((Get-Service $serviceDisplayName).Status -eq "Stopped"){
Write-Host "Service $serviceDisplayName has stopped - restarting service"
Start-Service -DisplayName $serviceDisplayName
}
The instructions on how to deploy this script are below:
- RDP into the server / PC where the BI4Cloud Desktop Connector is installed
Open Notepad and paste in the contents of the script above into it:
Save the script to somewhere handy - in this example that is C:\Bin:
Open the Task Scheduler application by typing in Task Scheduler into the windows start menu search field:
Click on Create Basic Task option within the Actions panel:
Enter a name (and description if you feel it is appropriate), then click Next:
Click Next:
Set a time which will be the first occurrence for the task to be executed, then click Next:
Click Next:
Enter in the path to the script created in Step 2 (and the start in directory path), then click Next:
(PowerShell must prefix file name as shown above)Check the option to Open the Properties dialog for this task when I click Finish, then click Finish:
Select the option to Run whether user is logged on or not, and the checkbox to Run with highest privileges:
Click on the Triggers tab:
Click Edit:
Check the option Repeat task every and select a suitable timeframe for which the script will run. We recommend an interval of up to 15 minutes:
- Click OK:
Click OK. You will be asked to enter a username & password for the account which will run the scheduled task. This account must be an account which does not have a password expiry set, so that the scheduled task will continue to be executable without needing to edit the scheduled task each time the password is changed:
- Close the Task Scheduler application.