web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Restart on prem window...
Power Automate
Unanswered

Restart on prem windows service

(0) ShareShare
ReportReport
Posted on by 2

Good day,

I have recently begun to start looking more closely at power automate. 

Specifically I was attempting to determine if it is possible to restart a windows service for an on premise server when an email is received.

For example, say an email is received that the widget service has failed and needs restarted.

I would like to grab the service name and the server it is on then from the email, then connect to the on premise server (through an on premise data gateway i assume) and perform a restart of the widget service.

 

Any help of suggestion to read, learn and or look into i would greatly appreciate it.

 

THank you very much.

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @JasonMcMahan,


    I would use a combination of a cloud flow (for the e-mail is received part) and a desktop flow (for accessing the server and perform a restart).

     

    For the e-mail trigger you could use When a new email arrives (V3) (if the email box is in fact hosted in Office 365).

    Office 365 Outlook - Connectors | Microsoft Docs

     

    With the Run a flow built with Power Automate for desktop action you can trigger a desktop flow on a specific machine Desktop flows - Connectors | Microsoft Docs

     

    With desktop flows you can use an action like start a Windows service:

    Windows services - Power Automate | Microsoft Docs

     

    The biggest challenge is probably routing it to the correct machine. Normally the desktop flow just uses the machine or a random machine of the machine group which was set in the connection of the Run a flow built with Power Automate for desktop action. However, you want to connect to a specific machine.

     

    You might want to look into the new Direct to machine connection option for this.

    https://docs.microsoft.com/en-us/power-automate/desktop-flows/manage-machines#trigger-a-desktop-flow-to-run-on-your-machine

     

    I can imagine it would be possible with one parent flow which routes to the correct child flows and in those child flows you can use the direct to machine connection. Haven't tried this myself though 😁

     

  • JasonMcMahan Profile Picture
    2 on at

    Thank you for the fast reply, it seems in my mind i was over simplifying it.

    I mistakenly thought the data gateway could be used as a gateway from the cloud to perform actions against resource on premise. Such as services, processes and such of an internal machine. 
    Am i understanding I would need to install desktop flow on every on premise server i want to perform actions against? 

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @JasonMcMahan,

     

    It depends a bit on the tasks. I was looking at the Windows Services action question. Those actions would be executed on the machine itself. In that case you want to register these individual machines, https://docs.microsoft.com/en-us/power-automate/desktop-flows/manage-machines#register-a-new-machine

     

    However, in your scenario you can probably also use (remote) PowerShell actions in a desktop flow on one server to restart things on other servers (if PowerShell remoting is enabled). In that case these kind of tasks can be executed from one machine. Again, thinking out loud, haven't tried it 😄

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard