Can you please share which Selenium supported language you are using for implementation? Sharing two options as per my experience with Selenium:
Recursively Closing Child Windows (or AD Windows)
Is it possible for you to recursively close the windows (using the Window Handles) till the time there is only one window open (which is the parent window)? With such a solution, even if a new AD window(s) pops-up, closing the window(s) will lead you to the Parent Window.
I have written a blog on a similar topic (involving annoying pop-ups) where I have demonstrated how to recursively close the windows (except the Parent Window). Attaching the code (from the above mentioned blog that has implementation in PHP with Selenium).