How to set "mail" attribute of a user account to null/empty?

%3CLINGO-SUB%20id%3D%22lingo-sub-1181438%22%20slang%3D%22en-US%22%3EHow%20to%20set%20%22mail%22%20attribute%20of%20a%20user%20account%20to%20null%2Fempty%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1181438%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20we%20deactivate%20users%20that%20we%20originally%20synchronized%20from%20our%20on%20premise%20ad%20and%20take%20away%20their%20license%2C%20they%20keep%20their%20email%20address%20in%20the%20mail%20attribute.%3CBR%20%2F%3ECan%20anyone%20tell%20me%20how%20to%20set%20the%20attribute%20to%20null%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20regards%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESascha%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1181438%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%20Management%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1182281%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20set%20%22mail%22%20attribute%20of%20a%20user%20account%20to%20null%2Fempty%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1182281%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F30965%22%20target%3D%22_blank%22%3E%40Sascha%20Halpape%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20this%20object%20is%20synchronized%20from%20your%20AD%20and%20has%20an%20old%20on-premise%20exchange%20account%20and%20you%20just%20want%20to%20provision%20a%20new%20cloud%20mailbox.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EClear%20the%20following%20attributes%20then%20force%20a%20sync.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20MsExchMailboxGuid%3C%2FP%3E%3CP%3E2.%20MsExchRecipientDisplayType%3C%2FP%3E%3CP%3E3.%20MsExchRecipientTypeDetails%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1182302%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20set%20%22mail%22%20attribute%20of%20a%20user%20account%20to%20null%2Fempty%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1182302%22%20slang%3D%22en-US%22%3EHi%20RaizelX%2C%3CBR%20%2F%3Ethe%20objects%20are%20no%20longer%20synced%20and%20we%20don't%20have%20an%20on%20premise%20AD%20or%20Exchange%20anymore.%20I%20don't%20want%20to%20provision%20a%20new%20cloud%20mailbox.%20We%20deactivate%20old%20accounts%20and%20remove%20the%20licenses.%20I%20do%20not%20understand%20why%20the%20email%20address%20is%20not%20removed%20from%20the%20attribute.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1182638%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20set%20%22mail%22%20attribute%20of%20a%20user%20account%20to%20null%2Fempty%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1182638%22%20slang%3D%22en-US%22%3E%3CP%3EGenerally%20speaking%2C%20you%20cannot.%20You%20can%20try%20the%20method%20detailed%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexchange-team-blog%2Fpermanently-clear-previous-mailbox-info%2Fba-p%2F607619%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexchange-team-blog%2Fpermanently-clear-previous-mailbox-info%2Fba-p%2F607619%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOr%20here%2C%20depending%20on%20the%20situation%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.michev.info%2FBlog%2FPost%2F2388%2Fpermanently-disable-a-mailbox-in-office-365%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.michev.info%2FBlog%2FPost%2F2388%2Fpermanently-disable-a-mailbox-in-office-365%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1182651%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20set%20%22mail%22%20attribute%20of%20a%20user%20account%20to%20null%2Fempty%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1182651%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F30965%22%20target%3D%22_blank%22%3E%40Sascha%20Halpape%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOh%2C%20I%20see.%20You%20just%20want%20to%20clear%20the%20mail%20attributes%20as%20you%20already%20have%20removed%20the%20licenses.%20I%20haven't%20tried%20to%20do%20so%20but%20maybe%20you%20can%20use%20the%20Remove-Mailbox%20cmdlet%3F%20Thank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1197837%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20set%20%22mail%22%20attribute%20of%20a%20user%20account%20to%20null%2Fempty%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1197837%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3BUnfortunately%2C%20it%20didn't%20help.%20Thanks%20anyway%20for%20your%20tips.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Dear community,

 

if we deactivate users that we originally synchronized from our on premise ad and take away their license, they keep their email address in the mail attribute.
Can anyone tell me how to set the attribute to null?

 

Best regards

 

Sascha

5 Replies
Highlighted

@Sascha Halpape 

 

If this object is synchronized from your AD and has an old on-premise exchange account and you just want to provision a new cloud mailbox.

 

Clear the following attributes then force a sync.

 

1. MsExchMailboxGuid

2. MsExchRecipientDisplayType

3. MsExchRecipientTypeDetails

Highlighted
Hi RaizelX,
the objects are no longer synced and we don't have an on premise AD or Exchange anymore. I don't want to provision a new cloud mailbox. We deactivate old accounts and remove the licenses. I do not understand why the email address is not removed from the attribute.
Highlighted

@Sascha Halpape 

 

Oh, I see. You just want to clear the mail attributes as you already have removed the licenses. I haven't tried to do so but maybe you can use the Remove-Mailbox cmdlet? Thank you!

Highlighted

@Vasil Michev Unfortunately, it didn't help. Thanks anyway for your tips.