Refer to can-these-lists-and-loops-be-refactored-into-something-better, it was brought up that the question may be off-topic for CR because "the code needs to work". I usually agree with this statement, but Active-Directory related code would never work for any code reviewer outside of the OP's environment. How should questions that work but won't work for a reviewer be handled?
It's not that the code needs to work for everyone, it just needs to work for you, in a real use case, and without errors, and producing the right results.
Code Review is one of the last things that should happen before code gets committed, shipped, packaged, whatever. When someone says:
This is untested as I'm just starting on the project.
it means that you cannot know the code works.... therefore it is not ready for review.
That's why I would have closed it.