我目前可以更改计算机列表中所有NICS的DNS服务器。
$computer = gc C:\computerlist.txt
$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration -computername $computer | where { $_.IPEnabled -eq "TRUE"}
ForEach($NIC in $NICs) {
$DNSServers = "10.1.140.3", "10.1.140.4" # CHANGE THIS TO THE IP Y