PowerShell for Windows Admins:

Network


August 25, 2012  2:06 AM

Windows 8 Networking cmdlets



Posted by: Richard Siddaway
Network, PowerShell 3, Windows 8, WMI

Windows 8 brings PowerShell v3 and a whole bunch of PowerShell modules.  One such module is NETTCPIP and as the name suggests is about networking.

PowerShell v3 automatically loads modules for you so as soon as PowerShell opens try

...

June 2, 2012  8:19 AM

Toggling between LAN and Wireless



Posted by: Richard Siddaway
Network, PowerShell 3, Windows 8, Windows Server 8, WMI

One of the questions in the recent Scripting Games involved toggling between a wireless and LAN connection. Only one was to be up at any one time.

This can be solved using WMI but becomes hugely simpler in Windows 8/2012 as we get a bunch of cmdlets for working with network adapters.

...


May 20, 2012  12:40 PM

Using Invoke-WmiMethod to set the DNS servers



Posted by: Richard Siddaway
Network, PowerShell 3, PowerShell v2, WMI

In the last post I showed that there was an issue with the way the SetDNSServerSearchOrder of the Win32_NetworkAdapterConfiguration class worked

This would work

$nic = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "Index=7"


May 20, 2012  4:34 AM

TCP/IP Alternative Configurations: pt IV reset to static address



Posted by: Richard Siddaway
Network, PowerShell, WMI

At some stage we may need to reset our NIC back to having a static address

$index = 7            
            
$nic 
				
				
  Bookmark and Share     0 Comments     RSS Feed     Email a friend


May 18, 2012  2:00 PM

TCP/IP Alternative Configurations: pt III set the alternative configuration



Posted by: Richard Siddaway
Network, PowerShell 3, PowerShell v2

 

We have seen how to set the NIC to use DHCP to get its address. This post shows how to set the alternative configuration on the NIC. If you just  want APIPA then do nothing – other wise use this script

$HKLM 
				
				
  Bookmark and Share     0 Comments     RSS Feed     Email a friend


May 16, 2012  3:12 PM

TCP/IP Alternative Configuration: pt II Set DHCP



Posted by: Richard Siddaway
Network, PowerShell, WMI

The next step on our journey to an alternative configuration is setting the NIC to use DHCP

I will keep cheating for now and specify the NIC – on my machine I now it is the NIC whose Win32_NetworkAdapterConfiguration has an Index of 7


				
				
  Bookmark and Share     0 Comments     RSS Feed     Email a friend


May 13, 2012  10:34 AM

TCP/IP Alternative Configuration: pt I The configuration



Posted by: Richard Siddaway
Network, PowerShell, WMI

A question on the forum got me wondering about setting the Alternative Configuration on a TCP/IP properties of a network adapter. NICs are normally configured to either DHCP or a static address. If you use DHCP another tab “Alternative Configuration” appears on the IPv4 properties dialog....


March 30, 2012  8:49 AM

PowerShell in Practice offer today only



Posted by: Richard Siddaway
Active Directory, Books, Hyper-V, Network, Operating System, PowerShell, Processor, Registry, WMI

Manning have PowerShell in Practice on a half price offer today. Go to www.manning.com and use code dotd0330cc when ordering


March 11, 2012  11:22 AM

Setting a Network address in Windows Server 8



Posted by: Richard Siddaway
Network, PowerShell 3, Windows Server 8, WMI

 

Windows Server 8 & Windows 8 bring a host of new functionality to us. I wanted to try out some of it so created a new VM and installed the OS – went for full GUI for now

Opened PowerShell and ran

Set-ExecutionPolicy remotesigned
Enable-PSRemoting...


January 1, 2012  6:12 AM

Changing IP Connection Metric



Posted by: Richard Siddaway
Network, PowerShell, WMI

A question on the forums asked how the connection metrics could be set on a Windows system.

We need to start by identifying the network adapters using this function

function test-ipmetric {
Get-WmiObject -Class Win32_NetworkAdapter -Filter "AdapterType = 'Ethernet...