Apr 29 2022 04:11 AM
Apr 29 2022 04:11 AM
I'm tryng to test Azure AD Connect before to apply it on our tenant; to do so, I created a dev subscription environment for testing on developer.microsoft.com and also downloaded the Windows 10 and Office 365 Deployment Lab Kit; I've done some testing, but now I need to reset the Azure environment to repeat some testing in clean environment: I could create another account, but I'd like to understand if is it possible to clean that created, beacuse if I have to test other things I don't want to create a dev environment every time.
Any help is appreciated.
Apr 29 2022 04:38 AM
Hi @Marco Mangiante ,
you could stop Azure AD sync, then delete users and start from scratch.
Please see how to turn off synchronization - Turn off directory synchronization for Microsoft 365 - Microsoft 365 Enterprise | Microsoft Docs.
I'm sure you know how to delete users from the Azure portal afterward. Once you turn off the syncing, users who have Yes under Directory synced will switch to No.
Apr 29 2022 04:46 AMSolution
The shortest answer to this is no, there is no way to completely reset a tenant to its initial, pristine configuration.
With respect to AAD Connect, you can approximate a reset of the tenant by uninstalling AAD Connect and removing all the user, group, computer, application and servicePrincipal objects but it's not a perfect solution.
While doing this will get rid of most of the visible artefacts, there'll be configuration settings that remain, and the more you've changed during your testing period, the more the residual settings accumulate until even after removing all these artefacts, the settings left over will be so different from a new tenant that it won't even remotely resemble a fresh environment.
The following article discusses all the prerequisites for deleting a tenant. You could do this if you wanted to then re-create a fresh tenant using the same namespaces but that isn't why I've included it here.
I've included it because it outlines many of the different areas you would want to clean out if you were trying to get your existing development tenant back to a close approximation of a fresh tenant. Again, the value of this will diminish over time and as you change more settings, but it's as good a guide as any if you're committed to this approach.
Personally, I'd recommend that if you absolutely must have a new pristine tenant, and you definitely have no further use for the current development tenant, that you delete the current one and start again.