Well firstly, you have figured how to connect your code to the users in NT? If not, you are looking at a large script, and many many security permissions being set.
If you already have that configured, congrats 🙂, different scripts return variables differently, so you would really need to post the script you are using here, then I will take a look and post the variables.
Good luck!
Luke