Run a script in Azure automation

João Ramos 20 Reputation points

Hi there,

I´m trying to run this powershell script in Azure automation but it gives this error. Does anybody have a tip on how to solve this?

Thank you,

Screenshot 2023-11-16 100240.jpg

O365 password expiry.txt

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
991 questions
0 comments No comments
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 17,396 Reputation points

    João Ramos, Thank you for posting this question on Microsoft Q&A.

    Based on the error as available in the attached email, Get-MgDomain is not being recognized as an available cmdlet. Based on the doc here, it is available in Microsoft.Graph.Identity.DirectoryManagement module.

    I would suggest importing the following modules to Azure Automation from gallery to ensure that the module is available for the cmdlet to run.

    • Microsoft.Graph.Identity.DirectoryManagement
    • Microsoft.Graph.Authentication

    Hope this helps.

    If the answer did not help, please add more context/follow-up question for it, and we will help you out. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.

    0 comments No comments

0 additional answers

Sort by: Most helpful