Hello,
Thank you for posting here.
We mainly focus on the issues or questions about Active Directory. I am sorry, we are not faimlar with Java and how to write script with Java.
I suggest we post our question on Java forum so that the engineers from Java can provide the further help to you.
Meanwhile, if there is any question in future, we warmly welcome you to post in this forum.
Thank you for your understanding and support.
Best Regards,
Daisy Zhou