r/exchangeserver • • 29d ago

Disable Mailbox -Identity **** -PermanentlyDisable Command no longer working

Pros!!

I used to be able to run the command Disable Mailbox -Identity **** -PermanentlyDisable via powershell, but in the last month I have noticed, I am getting this error message

How can i go about resolving this? What we are looking for is to disable/purge the mailbox of users while keeping the AD account intact

:

shines@abc.com - failed: ||Error on proxy command 'disable-Mailbox -Confirm:$False -PermanentlyDisable:$True -ErrorAction:'Stop' -Identity:'shines@abc.com'' to server ME3PR01MB69

5.ausprd01.prod.outlook.com: Server version 15.21.056.0000, Proxy method PSWS:

InternalServerError: Error executing cmdlet : {

"code": "InternalServerError",

"message": "Error executing cmdlet",

"details": [

{

"code": "AadDualWriteFailure",

"message": "|Microsoft.Exchange.Configuration.DualWrite.LocStrings.UnableToWriteToAadException|An Azure Active Directory call was made to keep object in sync between Azure Active Directory an

d Exchange Online. However, it failed. Detailed error message:\r\n\tUnable to update the specified properties for on-premises mastered Directory Sync objects or objects currently undergoing migrati

on. DualWrite (Graph) RequestId: 877abcebf-dbcc-4d5f-8813-d2435c1014ee\r\nThe issue may be transient and please retry a couple of minutes later. If issue persists, please see exception members for m

ore information.",

"target": ""

}

],

"innererror": {

"message": "Error executing cmdlet",

"type": "Microsoft.Exchange.Admin.OData.Core.ODataServiceException",

"internalexception": {

"message": "Exception of type 'Microsoft.Exchange.Management.PSDirectInvoke.DirectInvokeCmdletExecutionException' was thrown.",

"type": "Microsoft.Exchange.Management.PSDirectInvoke.DirectInvokeCmdletExecutionException"

}

},

"adminapi.warnings@odata.type": "#Collection(String)",

"@adminapi.warnings": []

} [Server=SY2PPF67CDB8BA3,RequestId=c30f213b-cfdf-7ece-3595-dc17b6c9e83b,TimeStamp=10/28/2026 1:13:07 AM] .

2 Upvotes

6 comments sorted by

3

u/worldsdream 29d ago

Follow this: https://o365info.com/remove-mailbox-microsoft-365/

It shows exactly how to remove the mailbox but keeps the user account.

1

u/Astroboy970 28d ago

Thanks u/worldsdream this does not seem to work because the mailbox I am removing are all of ex employees who left the company a while ago and we are in hybrid environment. They are configured as Shared mailbox for now.

I did try converting them to usermailbox but did not help.

MS support have been useless as well.

1

u/7amitsingh7 27d ago edited 27d ago

This error may occur if the user account is synced from on-premises Active Directory or is currently being migrated. I would check the directory sync and migration status first and retry the command after a few minutes. If it still fails then Microsoft support may need to investigate the issue.

Is this mailbox associated with an on-premises synced Active Directory account, or is any migration currently in progress?

1

u/Astroboy970 27d ago

Yeah, it is associated with On Prem AD but not currently being migrated. The directory sync is On. I just can't figure out why this is not working all of a sudden when it worked on multiple mailboxes before.

0

u/saltyslugga 28d ago

That error points to an on-prem mastered object or a migration in progress. I’d check the recipient type and migration status first.

For a synced remote mailbox with no migration running, remove its Exchange Online license, run Disable-RemoteMailbox in on-prem Exchange, then sync; the AD account stays intact. Disabling doesn’t guarantee an immediate purge: mailbox retention and any holds still apply.

1

u/Astroboy970 27d ago

I can confirm there is no hold or retemtion policy. It is currently a shared mailbox with no licenses. Yeah, I am more than happy to wait 30 days for it to purge as long as it disappears from EOL.
Also, I don't think we have any On prem Exchange server though.