Custom scripts -Endpoint detection UAG

while working on  an UAG case found a very nice technet link, thought of sharing it

https://support.microsoft.com/kb/955107