using PowerShell to managed Managed Metadata Term Store (SharePoint 2013)

Few weeks back we faced a strange issue in our envionrment where we faced serious performance issues while loading Managed Metadata Home page in SharePoint 2013 Sites. MMS Home page was loading either very slowly or some time simply does not return. It always end point showing multile authenticaton dialogs. To prove the point that there was nothing wrong in the platform I wrote some PowerShell script to manage MMS. The issue ended up being “Firewall”, “Reverbed” and “IPS”. Network team was able to solve it for us as there was nothing wrong from our side. But I found the script so positing it here.