So going back
(Get-WmiObject Win32_NetworkAdapterConfiguration -FIlter 'IPEnabled=True').DNSDomainSuffixSearchOrder
Only one of my adapters had an IP
It still returned duplicates
I just want all of my 20+ DNSs in a variable to use
Get DNS records
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- apowershelluser
- Posts: 194
- Last visit: Fri Mar 22, 2024 4:38 am
- apowershelluser
- Posts: 194
- Last visit: Fri Mar 22, 2024 4:38 am
Re: Get DNS records
This finally gives me one
Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {($_.IPEnabled -eq $true) -and ($_.DHCPEnabled -eq $true)} | select name,DNSDomainSuffixSearchOrder
There is also a VM adapter enabled, BUT it doesn't have any DNSDomains attached to it..
Regardless, I'm picking up what you're putting down.
Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {($_.IPEnabled -eq $true) -and ($_.DHCPEnabled -eq $true)} | select name,DNSDomainSuffixSearchOrder
There is also a VM adapter enabled, BUT it doesn't have any DNSDomains attached to it..
Regardless, I'm picking up what you're putting down.