Using Powershell to Change Network Settings

When administering Server 2012 without the GUI these come in very handy to know:


#Set an IPAddress
New-NetIPAddress -InterfaceAlias 'vEthernet' -IPAddress '172.16.1.1' -PrefixLength 24 -Verbose

#Set DNS Information
Set-DnsClientServerAddress -InterfaceAlias 'vEthernet' -ServerAddresses 172.16.1.2

#Change Network Profile
Get-NetConnectionProfile -Name 'Unidentified network' | Set-NetConnectionProfile -NetworkCategory Private -Verbose

Leave a Reply

Your email address will not be published. Required fields are marked *