Automatically Remove Licenses when an account is deactivated


Hi all

We run AD Connect sync what I am looking for is there a way to remove licences automatically from users when there account is disabled? Or does this mean that all data on exchange and One drive will be deleted?



4 Replies
best response confirmed by Ian Maclauchlan (Contributor)
Hi @Ian Maclauchlin,

There has been a long running uservoice open for this here.

I would usually say vote for this, but this hasn't been picked up in a significant time as it was opened in 2015! This means its very low down on the priority list and may not be picked up for a long time. I have been asked periodically about it over the years.

Removing the licence does not automatically delete the data. When a user's license is removed, data that is associated with that user account is held for 30 days. After the 30 day grace period, the data is deleted and can't be recovered. Files that are saved in OneDrive or SharePoint Online are not deleted.

See article here

Hope that answers your questions!

Best, Chris

Hi @Christopher Hoard 


Great!! I will create a PowerShell script to run as part of our nightly admins cycle.


Many thanks

That's partially correct...files stored in ODFB are going to be removed once the user is deleted from the AD that's the reason why the user's manager receives an e-mail to make a copy of the files of the disabled users....what you can do to keep also e-mail is to conver the user mailbox into a shared mailbox
Yes, sorry Juan Carlos I factored in the ODFB as part of the process but didn’t mention it explicitly.

Thanks for calling it out!

Best, Chris