You can translate the document:

Introduction

This document describes how to create Windows PowerShell scripts that can be used to:

Status Check and Restart
Alert if a Denodo Virtual DataPort (VDP) server is stopped and attempt to start it again, while storing the historical status of the VDP server to a log file.

Sequential Startup
Perform a sequential startup of multiple Denodo services in a defined order, ensuring each service is fully running before starting the next.

Keep in mind that this article applies to Denodo servers started as Windows services. If you start your server as a Process, refer to the Automating status check and startup of Denodo processes article.

Status Check and Restart

Sample script

The following script will check the status of the Virtual DataPort service and will try to restart it if stopped. A similar script can be used to check the status of any Denodo service.

Note: This script checks the status of the single specified service that is assumed to be already running, and attempts to start it once if it is found to be stopped. To cold-start multiple services from a stopped state, refer to the Sequential Startup script presented later in this article.

Tip: This script performs a status check based solely on information returned by the Windows OS. To do health monitoring of the service that is assumed to be already running, a status check based solely on information returned by the Windows OS is generally sufficient.

On the other hand, when cold-starting from a stopped state, the status returned by the Windows OS may briefly show as "Running" during the initial startup process, only to revert to a stopped state due to errors or other issues. For this reason, it is necessary to verify whether the service is actually ready to respond to client requests, using the method described in the reference article below. The Sequential Startup script takes this into account. For more information see Health Monitoring.

####################################################

#                                                  #

#      Virtual DataPort service status notifier    #

#                                                  #

####################################################

#-------------------Configuration------------------

Param(

     [string]$vdpServiceName,

     [string]$denodoHome,

     [string]$logFilePath

)

#-------------------------------------------------

function taskbarNotification($status){

        [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

        $objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon

        $objNotifyIcon.Icon = ($denodoHome + "\resources\Denodo\ico\denodo_platform.ico")

        $objNotifyIcon.BalloonTipText = ("VDP Server is " + $status)

        $objNotifyIcon.BalloonTipTitle = "Denodo Platform 9.0"

        $objNotifyIcon.Visible = $True

        $objNotifyIcon.ShowBalloonTip(10000)

}

function logStatus($status){

    $status = ((Get-Date).ToString() + " " +$status)

    Add-Content $logFilePath $status

}

if((Get-Service -Name $vdpServiceName).Status -eq "Stopped"){

    taskbarNotification("stopped")

    logStatus("VDP Server is stopped")

    Start-Service $vdpServiceName

    if((Get-Service -Name $vdpServiceName).Status -eq "Running"){

        taskbarNotification("running")

        logStatus("VDP Server is running")

        Exit

    }

    else{

        taskbarNotification("stopped. Unable to start the service.")

        logStatus("VDP Server is stopped. Unable to start the service.")

        Exit

    }

}

else{

    logStatus("VDP Server is running")

}

Running the script

1. Copy it to a text editor and save it to any location, for instance: C:\vdpService.ps1

2. Open a command prompt as an Administrator and execute the following:

powershell -ExecutionPolicy Bypass -File C:\vdpService.ps1 -vdpServiceName "vdpserver90" -denodoHome "C:\Denodo\DenodoPlatform9.0"  -logFilePath "C:\vdpService.log"

where:

  • powershell: The program to run.
  • -ExecutionPolicy Bypass: By default, unsigned PowerShell scripts are prevented from execution. This option allows bypassing this restriction.
  • -File: Path to the PowerShell script.
  • -vdpServiceName: The service name for the VDP Server. To get the name of the service go to Start > Run and run services.msc. Double click on the service name, for instance, for Denodo VDP 9.0 the service name will be "Denodo VQL Server 9.0". The name to be used in the script will be the value for "Service name" in the pop-up window under the “General” tab. In a default installation of Denodo Platform 9.0, this value will be vdpserver90.
  • -denodoHome: The path to the Denodo Platform installation. For instance “C:\Denodo\DenodoPlatform9.0”.
  • -logFilePath: The path where the log file will be saved. For instance “C:\vdpService.log”.

Sequential Startup

Sample script

The following script will perform a sequential startup of multiple Denodo services in a defined order, ensuring each service is fully running before starting the next.

################################################################################

#                                                                              #

#      Denodo-related Windows Services sequential startup with verification    #

#      (Last Updated: 26th March 2026)                                         #

#                                                                              #

################################################################################

# Elevate to administrator

# Check if the process running this ps1 file has administrator privileges.

#   If True  -> The exit in the if block is not executed, and the main process continues.

#   If False -> "Launch PowerShell with administrator privileges via UAC prompt" is executed.

if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole('Administrators')) {

    Start-Process powershell.exe -Verb RunAs -ArgumentList "-File `"$PSCommandPath`""

    exit

}

# Service startup function (using URL for startup verification)

# Sends a request to the service monitoring URL and considers startup successful if HTTP 200 is returned.

# Checks every [int]$IntervalSeconds seconds, and times out after [int]$MaxSeconds seconds.

function ServiceStartWithUrlCheck {

    param (

        [string]$ServiceName,

        [string]$StatusCheckUrl,

        [int]$IntervalSeconds = 5,

        [int]$MaxSeconds = 600

    )

    $startTime = Get-Date

    # Check if the specified Windows service exists (if the service is not registered, an exception is thrown and control moves to catch, then returns from the function)

    try {

        Get-Service -Name $ServiceName -ErrorAction Stop

    }

    catch {

        Write-Host "$(Get-Date) - $ServiceName is NOT registered" -ForegroundColor Yellow

        return

    }

    Write-Host "$(Get-Date) - $ServiceName launch-process started." -ForegroundColor Yellow

    while ($true) {

        try {

            # Send HTTP request and check status code (if the HTTP request fails, an exception is thrown and control moves to catch)

            $response = Invoke-WebRequest -Uri $StatusCheckUrl -UseBasicParsing -TimeoutSec 1

            if ($response.StatusCode -ne 200) {

                # If status code is not 200, throw an exception to move to catch

                throw "Unexpected status code: $($response.StatusCode)"

            }

            # If status code is 200, consider the service started and return from the function

            Write-Host "$(Get-Date) - $ServiceName is online" -ForegroundColor Green

            Get-Service -Name $ServiceName -ErrorAction Ignore

            return

        }

        catch {

            # If connection failed, timed out, or status code is not 200, attempt to start the service

            try {

                # Start the service (if startup fails, -ErrorAction Stop causes control to move to catch)

                Start-Service -Name $ServiceName -ErrorAction Stop

                Write-Host "$(Get-Date) - $ServiceName start-command triggered." -ForegroundColor Yellow

            }

            catch {

                # Service startup failed (this occurs frequently at each interval, so no log output is performed)

            }

        }

        # Timeout check (if startup does not complete within the allowed time, return from the function)

        $elapsedTime = (Get-Date) - $startTime

        if ($elapsedTime.TotalSeconds -ge $MaxSeconds) {

            Write-Host "$(Get-Date) - $ServiceName is NOT started due to timed-out (${MaxSeconds} sec)" -ForegroundColor Yellow

            return

        }

        # Wait for the specified interval, then loop back to recheck service startup status

        Start-Sleep -Seconds $IntervalSeconds

    }

}

# Service startup function (using a dedicated ping command for startup verification)

# Executes the service monitoring command and considers startup successful if the response contains "OK".

# Checks every [int]$IntervalSeconds seconds, and times out after [int]$MaxSeconds seconds.

function ServiceStartWithCmdCheck {

    param (

        [string]$ServiceName,

        [string]$StatusCheckCommand,

        [int]$IntervalSeconds = 5,

        [int]$MaxSeconds = 600

    )

    $startTime = Get-Date

    # Check if the specified Windows service exists (if the service is not registered, an exception is thrown and control moves to catch, then returns from the function)

    try {

        Get-Service -Name $ServiceName -ErrorAction Stop

    }

    catch {

        Write-Host "$(Get-Date) - $ServiceName is NOT registered" -ForegroundColor Yellow

        return

    }

    Write-Host "$(Get-Date) - $ServiceName launch-process started." -ForegroundColor Yellow

    while ($true) {

        try {

            # Execute the service monitoring command and check the result (if the command fails, an exception is thrown and control moves to catch)

            $response = cmd.exe /c $StatusCheckCommand 2>&1 | Out-String

            if ($response -notmatch " OK") {

                # If the response does not contain " OK", throw an exception to move to catch

                throw "Unexpected response: $response"

            }

            # If the command result is successful, consider the service started and return from the function

            Write-Host "$(Get-Date) - $ServiceName is online" -ForegroundColor Green

            Get-Service -Name $ServiceName -ErrorAction Ignore

            return

        }

        catch {

            # If the command failed or the response does not contain " OK", attempt to start the service

            try {

                # Start the service (if startup fails, -ErrorAction Stop causes control to move to catch)

                Start-Service -Name $ServiceName -ErrorAction Stop

                Write-Host "$(Get-Date) - $ServiceName start-command triggered." -ForegroundColor Yellow

            }

            catch {

                # Service startup failed (this occurs frequently at each interval, so no log output is performed)

            }

        }

        # Timeout check (if startup does not complete within the allowed time, return from the function)

        $elapsedTime = (Get-Date) - $startTime

        if ($elapsedTime.TotalSeconds -ge $MaxSeconds) {

            Write-Host "$(Get-Date) - $ServiceName is NOT started due to timed-out (${MaxSeconds} sec)" -ForegroundColor Yellow

            return

        }

        # Wait for the specified interval, then loop back to recheck service startup status

        Start-Sleep -Seconds $IntervalSeconds

    }

}

# Start each service ( Adjust service names, URLs, ping command paths, etc. to match your environment. Comment out services that do not need to be started. If TLS/SSL is applied, change the port setting. )

# [ Windows services for DenodoPlatform9 ]

ServiceStartWithCmdCheck -ServiceName "vdpserver90" -StatusCheckCommand "C:\denodo\DenodoPlatform9\bin\ping.bat -t 5000 -v //localhost:9999/admin"

ServiceStartWithUrlCheck -ServiceName "designstudio9" -StatusCheckUrl "http://localhost:9090/denodo-design-studio/Ping"

ServiceStartWithUrlCheck -ServiceName "denododatacatalog9" -StatusCheckUrl "http://localhost:9090/denodo-data-catalog/Ping"

ServiceStartWithUrlCheck -ServiceName "diagnosticmonitoring90" -StatusCheckUrl "http://localhost:9090/diagnostic-monitoring-tool/Ping"

ServiceStartWithCmdCheck -ServiceName "schedulerserver9" -StatusCheckCommand "C:\Denodo\DenodoPlatform9\tools\scheduler\ping.bat -t 5000 -v"

ServiceStartWithCmdCheck -ServiceName "indexerserver9" -StatusCheckCommand "C:\Denodo\DenodoPlatform9\tools\arn-index\ping.bat -t 5000 -v"

ServiceStartWithUrlCheck -ServiceName "schedulerwebadmintool9" -StatusCheckUrl "http://localhost:9090/webadmin/denodo-scheduler-admin/Ping"

# [ Windows services for SolutionManager9 ]

ServiceStartWithUrlCheck -ServiceName "licensemanagerserver9" -StatusCheckUrl "http://localhost:10091/pingLicenseManager"

ServiceStartWithUrlCheck -ServiceName "solutionmanagerserver9" -StatusCheckUrl "http://localhost:10090/pingSolutionManager"

ServiceStartWithUrlCheck -ServiceName "solutionmanagerwebtool9" -StatusCheckUrl "http://localhost:19090/solution-manager-web-tool/Ping"

ServiceStartWithUrlCheck -ServiceName "schedulerwebadmintool9" -StatusCheckUrl "http://localhost:19090/webadmin/denodo-scheduler-admin/Ping"

ServiceStartWithUrlCheck -ServiceName "diagnosticmonitoring90" -StatusCheckUrl "http://localhost:19090/diagnostic-monitoring-tool/Ping"

ServiceStartWithUrlCheck -ServiceName "designstudio9" -StatusCheckUrl "http://localhost:19090/denodo-design-studio/Ping"

#ServiceStartWithCmdCheck -ServiceName "vdpserversm90" -StatusCheckCommand "C:\Denodo\DenodoSolutionManager9\bin\ping.bat -t 5000 -v //localhost:19999/admin"

Running the script

1. Copy it to a text editor and save it to any location, for instance: C:\DenodoServiceStart.ps1

2. Open a command prompt as an Administrator and execute the following:

powershell -ExecutionPolicy Bypass -File C:\DenodoServiceStart.ps1

where:

  • powershell: The program to run.
  • -ExecutionPolicy Bypass: By default, unsigned PowerShell scripts are prevented from execution. This option allows bypassing this restriction.
  • -File: Path to the PowerShell script.

Automating the execution of the scripts

1. Open the Windows Task Scheduler (Control Panel > System and Security >  Administrative Tools > Task Scheduler).

2. Click on "Create Task..." in the right side pane.

3. Type in the name and description in the "General" tab and check "Run with highest privileges".

4. Use the "Trigger" tab to schedule when this task should run.

5. In the "Actions" tab, for the "Program/script" option, type the same command as for the manual execution:

powershell -ExecutionPolicy Bypass -File C:\vdpService.ps1 -vdpServiceName "vdpserver90" -denodoHome "C:\Denodo\DenodoPlatform9.0"  -logFilePath "C:\vdpService.log"

6. Save the task.

NOTE: Make sure to change the configuration in both Denodo Solution Manager and Denodo Platform.

Disclaimer

The information provided in the Denodo Knowledge Base is intended to assist our users in advanced uses of Denodo. Please note that the results from the application of processes and configurations detailed in these documents may vary depending on your specific environment. Use them at your own discretion.

For an official guide of supported features, please refer to the User Manuals. For questions on critical systems or complex environments we recommend you to contact your Denodo Customer Success Manager.
Recommendation

Questions

Ask a question

You must sign in to ask a question. If you do not have an account, you can register here