I am trying to develop an add-in for SharePoint Online that ensures all document libraries created get my company's base content type and the standard document content type gets removed.
I have the ListAdded remote event receiver working to do this task. I also have a WebProvisioned event receiver that will attach the listAdded event receiver to new sub-sites.
This now kinda works, however when the add-in gets removed it only removes the event receivers from the top level site and the event receivers in sub-sites get orphaned and can't be deleted. How can I loop through the sub-sites in the appuninstalling event?
I'd like to avoid having to install the add-in to every subsite.