Hi Himanshu,
In my case I wrote a Java program against the WebServices API to get a list of users that need to be disabled (I cross-match with LDAP output of disabled users). It's run automatically using the Windows AT command.
https://support.microsoft.com/en-us/kb/313565In my opinion that's the best and simplest way to do this. The AT command invokes a bat file that invokes the Java program with proper command-line arguments. The password is in a keystore, stored securely, and not in plaintext format.
Hope this helps you? Please don't hesitate to post additional questions if you need any clarification.
Sesh