I appreciate the breakdown, and I get all of it. Funny thing, if I run
(Get-WmiObject Win32_NetworkAdapterConfiguration -FIlter 'IPEnabled=True').DNSDomainSuffixSearchOrder
it returns duplicates. Which if I'm reading you right, it should not
()
This is why I need to use the -unique
If I use
Get-WmiObject Win32_NetworkAdapterConfiguration -FIlter 'ServiceName="Netwtw04"'|
select ServiceName, DNSDomainSuffixSearchOrder
It returns nothing but the service name.
Why I'm doing this:
I ping a computer and lets say its in our California office, and on wireless. It will have a different DNS than our New York offices on wireless.
So, I ping the computer to test it's online, then I ping the computer foreach DNS to get my fully qualified domain name
some of the computers on our domain require the FQDN to access
another reason I do this is so I can turn my results into an object that I can display in a datagridview if need be
If, there is an easier way to which DNS a remote computer is connected to, and can output it to an object, I'm all ears