Zmiana adresu ip oraz dns w Powershell v3

Zmiana IP, interfejs wskazujemy po nazwie w parametrze InterfaceAlias. Stałe IP:

New-NetIPAddress -IPAddress 192.168.1.51 -InterfaceAlias "Ethernet" -DefaultGateway 192.168.1.1 -AddressFamily IPv4 -PrefixLength 24

Dynamiczne:

Set-NetIPInterface -InterfaceAlias "Ethernet" -DHCP Enabled

Adresy DNS ustawiamy poleceniem Set-DnsClientServerAddress, interfejs wskazujemy parametrem InterfaceAlias tak jak w poleceniu New-NetIPAddress. Stały DNS:

Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses ("192.168.1.50","192.168.1.51")

DNS z DCHP:

Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ResetServerAddresses

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera
Skip to toolbar