Quarterbore,
Combining two scripts can at times be very problematic.
I suggest that you try the simple version of this script
https://vborg.vbsupport.ru/showthread.php?t=100992 and see if you can get that working first.
Also, I recommend trying just the test login listed in part five of troubleshooting (post 2), to rule out any thing besides a clash between this script and the other one.
If we can get the basic one working, then we can work on finding out where the problem is here.