Hi @2sigmas. Welcome to GoDaddy Community! I'm not sure why your script isn't working. I'd suggest posting the full script (minus any login information of course). That way, others can look at it and see if they can spot any other issues within it. Hope you're able to figure this out.
JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.