Automating the service restart from another server in Windows server 2016


I want to restart the services on Application server from DB server depending on the output of query.

Ex: In DB server i have written one procedure which will generate automated mail if no transaction inserted in one table.

If no transaction inserted from last 3 minutes , i want to restart the dependent service which is on another app server