Nice script, but the kb article: http://support.microsoft.com/kb/2806535 doesn't completely jive with your code. What am I missing?
Server 1
HTEnabled: 1
hyperthreadingRatio: 12
logical cpus: 24
physical cpus: 2
logical cpus per numa: 12
NoOfNuma: 2
MaxDop setting should be : 6
Server 2
HTEnabled: 2
hyperthreadingRatio: 16
logical cpus: 64
physical cpus: 4
logical cpus per numa: 16
NoOfNuma: 4
MaxDop setting should be : 4
I realize these are just suggestions; but something doesn't seem right to me that a server (#2) above with 4 processors instead of 2, and 8 cores per physical CPU instead of 6; would recommend the MAXDOP at 4, versus 6 for the less powerful server.
The kbb article above suggests 8 my scenario above. "For servers that have NUMA configured and hyperthreading enabled, the MAXDOP value should not exceed number of physical processors per NUMA node."
Bob McC