Created
April 18, 2014 22:43
-
-
Save loonison123/11067435 to your computer and use it in GitHub Desktop.
Disable and reconfigure a static IP address on Windows Server 2012 using powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # List all network adapters (Find the name) | |
| Get-NetAdapter | |
| # (Administrator) Disable an ethernet adapter (Won't prompt you to confirm) | |
| Disable-NetAdapter -Name "Ethernet" -Confirm:$false | |
| # If you want to view some IP information | |
| Get-WmiObject -Class win32_networkadapterconfiguration -filter ipenabled=TRUE -computername . | |
| # Set static IP | |
| New-NetIpAddress 192.168.1.5 -InterfaceAlias "Wi-Fi" -DefaultGateway 192.168.1.1 -AddressFamily IPv4 -PrefixLength 24 | |
| # Set DNS Server | |
| Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi" -ServerAddresses 192.168.1.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment