Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 208545

Re: VM command POWERSHELL for to position DNS on a VM

$
0
0

Hello,

 

Do you want it to work with Powershell v3 for Windows 2012 and Windows 2008(R2) ?

In any case, you can try this (not tested)

 

Function Set-DNSServer {

    param (

        [IpAddress]$DNSServer,

        [IpAddress]$NicIP

    )

    Get-WmiObject Win32_NetworkAdapterConfiguration | ? { $_.IPEnabled -eq "TRUE" } | % {

        if ($_.IpAddress -eq $NicIP) {

            $x = $IP.SetDNSServerSearchOrder($DNSServer)

        }

    }

}

 

 

Regards


Viewing all articles
Browse latest Browse all 208545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>