Remove Office 365 license in user modification template

Remove Office 365 license in user modification template

I have a user termination template but I would like to be able to have it remove the user's Office 365 e3 license as well. I can't seem to find a way to do this other than using psremoting to my 365 tenant in a custom script. I can add licenses during creation, i should be able to remove them during termination.
Is there an easy way to do this?

                New to ADSelfService Plus?