Commands on Windows through Azure

Guilherme Brilhante Guimarães 61 Reputation points
2022-08-10T19:16:53.427+00:00

I'm trying to build automation for Windows (execute tasks and routines) through Azure, but I found little material on the topic, just referring to Windows VM in Azure.
Is it possible to run PowerShell scripts on Windows machines in my domain through Azure?

Azure Cloud Services
Azure Cloud Services
An Azure platform as a service offer that is used to deploy web and cloud applications.
771 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 57,831 Reputation points Volunteer Moderator
    2022-08-10T19:53:55.27+00:00

    Hi @Guilherme Brilhante Guimarães

    You could look into deploying PowerShell scripts through Intune. You would need to set up Intune, enroll your devices and then you can deploy scripts to devices connected to your Azure tenant.

    Deployment guide: Setup or move to Microsoft Intune

    https://learn.microsoft.com/en-us/mem/intune/fundamentals/deployment-guide-intune-setup

    Enroll devices in Microsoft Intune

    https://learn.microsoft.com/en-us/mem/intune/enrollment/

    Use PowerShell scripts on Windows 10/11 devices in Intune

    https://learn.microsoft.com/en-us/mem/intune/apps/intune-management-extension

    ------------------------------

    If this is helpful please accept answer.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Andreas Baumgarten 123.5K Reputation points MVP Volunteer Moderator
    2022-08-10T19:44:26.877+00:00

    Hi @Guilherme Brilhante Guimarães ,

    maybe this helps:
    https://techcommunity.microsoft.com/t5/itops-talk-blog/how-to-run-scripts-in-your-azure-vm-by-using-run-command/ba-p/1362360
    https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

  2. Dillon Silzer 57,831 Reputation points Volunteer Moderator
    2022-08-10T19:45:09.827+00:00

    Hi @Guilherme Brilhante Guimarães

    You an run PowerShell scripts through:

    1) Windows VM (run PowerShell on the virtual machine)

    Run scripts in your Windows VM by using action Run Commands

    https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command

    Windows Virtual Machines Pricing

    https://azure.microsoft.com/en-ca/pricing/details/virtual-machines/windows/

    2) Run PowerShell scripts through Azure Functions (more cost effective as it only runs when triggered)

    Azure Functions PowerShell developer guide

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-powershell?tabs=portal

    A nice guide to setting up a PowerShell Azure Function:

    https://tminus365.com/running-powershell-in-azure-functions/


    If this is helpful please accept answer.

    0 comments No comments

  3. Guilherme Brilhante Guimarães 61 Reputation points
    2022-08-10T19:50:24.847+00:00

    Thanks for the answers, but in both answers you are referring to virtual machines created inside Azure. But my question is whether it is possible to run a script on physical machines of users in my organization through Azure.

    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.