Hi,
Thanks for posting on our new Q&A platform.
Since your issue is related to script, I suggest you ask over at the dedicated forum over here:
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
In addition, you could accept the useful reply as answer if you want to end this thread up.
Best Regards,
Sunny