Forum Discussion

ctedesco3307's avatar
ctedesco3307
Copper Contributor
Dec 14, 2023

Azure Runbooks - Powershell

Hi All- taking my first stab at trying to run a powershell script through runbooks. I have a script that works through powershell but I can't get it to execute (I'm using the test pane) through runbooks. I've stripped it all down to basically one command to troubleshoot, but it's not working so I know I am missing something. I followed this blog to get set up runbooks How to run PowerShell scripts to automate manual processes in Office 365 | Practical365  

 

The single command I am trying to execute is 

Get-AzureADUser -ObjectId "email address removed for privacy reasons"  
I added the AzureAD module but I keep getting the below error. Does anyone know what I am missing? Thanks in advance. 
 

 

 
 
  • ctedesco3307 

     

    Did you install and connect AzureAD powershell v2 yet?

     

    Install-Module AzureAD -Force

     

    Connect-AzureAD

    Get-AzureADUser
    • ctedesco3307's avatar
      ctedesco3307
      Copper Contributor
      yes. Like I said, it works in powershell just not through runbooks