How to run a powershell script on a server using Azure Logic Apps

Karl Schmitt 0 Reputation points
2024-01-29T20:34:51.3666667+00:00

I am looking to automate our user on-boarding experience by having HR submit a new item in a SharePoint list which will then kick off the automation process. I have attempted doing this using Power Automate however my flow errors out due to PA not having administrator privileges to run a powershell script. What I am looking to do with Azure Logic Apps is to take the data from every new entry in a SharePoint list, send the data over to one of our AD servers which run runs a powershell command based off the data HR submits. I don't see any feature with Azure Logic apps to allow me to connect to another server.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dillon Silzer 57,826 Reputation points Volunteer Moderator
    2024-01-30T01:04:47.9066667+00:00

    Hi Karl,

    Based on what you have written, this is my understanding. You are looking to send a change to a local AD server (not Azure) and issue a change to Active Directory.

    I'd recommend that you build an on-prem app (in either PHP or some other language) that can communicate with the local AD server. The page should allow for POST requests where you send information and authorization to this page that pushes the change to your local AD.

    This would be a lot easier to do in AAD (entra) as you can invoke PowerShell commands to make changes, but with the on-prem solution you require an intermediary to convert those requests into local AD changes.

    Perhaps this might be your answer:

    https://www.manageengine.com/products/ad-manager/active-directory-api/

    If this is helpful please accept answer.

    0 comments No comments

  2. Pramod Valavala 20,656 Reputation points Microsoft Employee Moderator
    2024-01-31T16:01:46.9633333+00:00

    @Karl Schmitt While Azure Logic Apps doesn't have a feature to do this out of the box, Azure Functions along with Hybrid Connections supports scenarios like this. The doc linked here walks through on how you can set this up. Another option that you could consider is to create a daemon service that runs on one of your local machines to perform the actions required and listens to a Service Bus Queue for requests. This is easier to set up from a network perspective since you only require outgoing connectivity. The response from the daemon service, if required, would have to be in a separate queue which would mean having a separate logic app to handle the responses though. Note that Hybrid Connections build upon Service Bus/Relay internally and abstract away these details for you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.