Can't Use Enable-Mailbox on Powershell ExchangeOnlineManagement

Levy Ackerman 21 Reputation points
2022-09-17T03:51:44.09+00:00

Hello,

I already enable auto expanding for my organizations/tenant, but if this configuration enabled, will make all user in my organization using auto-expanding archiving. (documentation: https://learn.microsoft.com/en-us/microsoft-365/compliance/enable-autoexpanding-archiving?view=o365-worldwide)
242102-image.png

Then I want to restrict auto-expanding archiving for specific user. As per information in documentation, i need to run this command in PowerShell:

Enable-Mailbox <user mailbox> -AutoExpandingArchive

But I'm getting error Enable-Mailbox : The term 'Enable-Mailbox' is not recognized as the name of a cmdlet, function, script file, or operable program.
242142-image.png

I'm using ExchangeOnlineManagement version 2.0.5 .
242191-image.png

License Office version: Office 365 E5

i can use command Connect-ExchangeOnline, Get-EXOMailbox and other, but why i can't use command Enable-Mailbox .

Please advice.
Thank you.

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,493 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 104.3K Reputation points MVP
    2022-09-17T06:45:48.4+00:00

    Well, you do need permissions to run the cmdlet. By default, Enable-Mailbox is available to users who have the Mail Recipients role assigned:

    Get-ManagementRole -Cmdlet Enable-Mailbox  
      
    Name              RoleType  
    ----              --------  
    Mail Recipients   MailRecipients  
    

    The module version does not play a big role here, as cmdlets are generated/downloaded from the remote session. Check your permissions.


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.