Permissions needed for helpdesk to add a O365 mailbox to existing AD arrount?

Dave Bryan 96 Reputation points
2021-01-12T19:23:18.41+00:00

Exchange 2016/O365 environment

I am having issues with enabling out helpdesk to run the powershell commands to enable-remotemailbox. If I login to the same workstation with my admin credentials, everything works 100%. When the helpdesk login to the same workstation with recipient management permissions and run the same script they get an error: "No provisioing Handler is installed" - Does anyone know what I am missing?

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;
$muser = Read-Host -Prompt 'Enter the user account name of the User that needs a mailbox'
Enable-RemoteMailbox $muser -RemoteRoutingAddress "$muser@Company portal .mail.onmicrosoft.com"

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,166 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,335 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,875 questions
0 comments No comments
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,206 Reputation points
    2021-01-13T07:05:06.43+00:00

    @Dave Bryan

    To run the Enable-RemoteMailbox command, you need to make sure the mailbox that you used contained in those permission group:

    55980-qa-kyle-14-52-40.png

    Then, connect to to Exchange with remote PowerShell, after that, run the Enable-RemoteMailbox command directly.
    56103-qa-kyle-14-58-48.png


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Andy David - MVP 141.1K Reputation points MVP
    2021-01-12T19:55:47.807+00:00

    Hi there. Your method is not supported. ( Add-PSSnapin )
    You have to use remoting:
    https://learn.microsoft.com/en-us/powershell/exchange/connect-to-exchange-servers-using-remote-powershell?view=exchange-ps

    Also, if you could, please mark an answer as accepted for your previous question:
    https://learn.microsoft.com/en-us/answers/questions/213593/simple-method-for-helpdesk-to-create-mailbox-for-e.html

    0 comments No comments

  2. Dave Bryan 96 Reputation points
    2021-01-13T06:07:02.88+00:00

    Thanks for your feedback Andy and I will mark your answer as solution on the other thread.

    I just keep having issues with this process. When I run the exact same script I posted with my account, it works 100% so was thinking it has to be something with permissions.

    I did try with psremoting as shown below and it fails with the same error

    $UserCredential = Get-Credential
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangesrv.contoso.com/PowerShell/ -Authentication Kerberos -Credential $UserCredential
    Import-PSSession $Session -DisableNameChecking

    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;

    $muser = Read-Host -Prompt 'Enter the user account name of the User that needs a mailbox(example: pmanning)'
    Enable-RemoteMailbox $mvuser -RemoteRoutingAddress "$muser@Company portal .mail.onmicrosoft.com"
    Add-ADGroupMember -identity ExchOnline-Plan1 -members $muser

    0 comments No comments

  3. Dave Bryan 96 Reputation points
    2021-01-13T19:54:55.563+00:00

    Thanks guys - I was just about to run that powershell command so that helped, but the helpdesk are in recipient management(think that is where it matters) and same for ExchangeOnline and that role covers both Mail Recipient Creation and Mail Recipients. So I must be missing something else.

    When I run that command with my admin credentials, on the same computers, it executes fine. When they run it they get the error

    "Enable-RemoteMailbox : No provisioning handler is installed.
    At line:1 char:1

    • Enable-RemoteMailbox $muser -RemoteRoutingAddress "$muser@Company portal ...
    • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [Enable-RemoteMailbox], InvalidOperationException
    • FullyQualifiedErrorId : [Server=ITTOOLSSRV,RequestId=907dcce1-4e09-4cb7-9e58-13d0cd576916,TimeStamp=1/13/2021 6:05:17 AM] [FailureCategory=Cmdlet-InvalidO
      perationException] 13B30823,Microsoft.Exchange.Management.RecipientTasks.EnableRemoteMailbox
      "