Run a script in Azure automation

João Ramos 20 Reputation points
2023-11-16T17:36:47.5033333+00:00

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.
1,273 questions
0 comments No comments
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 21,386 Reputation points
    2023-11-20T10:26:21.43+00:00

    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

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.