All you really need to pay attention to is this bit here: _GetArrData($objItem.DNSServerSearchOrder ) Basically, what you want is to pass the array property from your WMI query to _GetArrData and it will spit out an array of its contents.