Getting Bed request when converting user mailbox into shared using Powershell

Abhishek Goyal 131 Reputation points
2023-05-02T12:12:08.97+00:00

I was trying to convert user mailbox into shared mailbox using powershell command

Set-Mailbox -Identity "example@example.com" -Type Shared

But got the error:

write-Error: {"error":{"code":"BadRequest","message":"Cmdlet needs proxy. Current Server FQDN : DM8PR22MB2759.namprd22.prod.outlook.com,
Required Server FQDN : DS0PR22MB4123.namprd22.prod.outlook.com","innererror":{"message":"Cmdlet needs proxy. Current Server FQDN
: DM8PR22MB2759.namprd22.prod.outlook.com, Required Server FQDN :
DS0PR22MB4123.namprd22.prod.outlook.com","type":"Microsoft.Exchange.Admin.OData.Core.ODataServiceException","stacktrace":"   at
Microsoft.Exchange.AdminApi.CommandInvocation.CommandInvocation.InvokeCommand(QueryContext queryContext, CmdletInvokeInputType
cmdletInvokeInputType)\r\n   at
Microsoft.Exchange.Admin.OData.Core.PathSegmentToExpressionTranslator.Translate(OperationImportSegment segment)\r\n   at
Microsoft.Exchange.Admin.OData.Core.QueryContext.ResolveQuery(ODataContext context, Int32 level)\r\n   at
Microsoft.Exchange.Admin.OData.Core.Handlers.OperationHandler.Process(IODataRequestMessage requestMessage, IODataResponseMessage
responseMessage)\r\n   at Microsoft.Exchange.Admin.OData.Core.Handlers.RequestHandler.Process(Stream requestStream)"}}}

I used ExchangeOnlineManagement Module. For making connection with exchange online I used a azure App with permission Exchange.Manage(Delegated) and login using the user who are Exchange Administrator.

I think my permissions are correct. Please help me out for same.

Appreciate your efforts.

Microsoft Exchange Online
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.
3,349 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Vasil Michev 70,486 Reputation points MVP
    2023-05-02T16:23:35.9+00:00

    Try logging in directly with the user, using Connect-ExchangeOnline. If the same issue occurs, best open a support case. If the cmdlet works OK, the issue is likely with the way you handle authentication.