I am bit surprised servers hang already on netsh commands. Isn't the real problem somewhere else? Maybe the dynamic pool is too small, or maybe the rest for the system is too small. It would be good to investigate. Have a look at number of opened connections before you tun netsh and modifying ephemeral port pool.
Subsequent tsagent failures may be impacted by the same thing.
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.