Why is Set-Mailbox Command Not Recognized in Azure Runbook?

0
8
Asked By TechieNinja42 On

I'm facing an issue with running a script in my Azure Runbook. I'm using PowerShell 7.4 with the ExchangeOnlineManagement module, and I have a cloud-only Exchange setup. My script includes connecting with a managed identity that has the necessary permissions, but when I try to execute the Set-Mailbox command, I get an error saying it's unrecognized. Other commands like Get-Mailbox and Add-DistributionGroupMember work fine. Has anyone dealt with a similar issue?

5 Answers

Answered By AutomationFanatic88 On

You might want to try using the set-exomailbox command instead. It sometimes works better in specific environments.

Answered By ScriptWiz101 On

Are you sure the managed identity has the right roles assigned? It seems like it might not have the necessary permissions if it can't recognize Set-Mailbox.

Answered By DevOpsDynamo On

Make sure to use the import command for the module. You can check with a verbose command to ensure that it's showing up as expected.

Answered By CloudTechie99 On

Did you import the module correctly in your Automation Account? That can be a common oversight.

Answered By PowershellGuru77 On

This sounds like it could be a permissions issue or a problem with the module installation. I'd recommend creating an app registration with the necessary permissions you mentioned. Test out the script locally first to ensure everything works before moving to the runbook with managed identity.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.