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.
Getting Bed request when converting user mailbox into shared using Powershell

Abhishek Goyal
131
Reputation points
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.