PowerShell for Windows Admins:

Network


February 19, 2014  12:02 PM

Windows PowerShell Networking Guide



Posted by: Richard Siddaway
Books, Network, PowerShell

A free ebook on managing various aspects of your networking is now available from

Bookmark and Share     0 Comments     RSS Feed     Email a friend

November 29, 2013  4:56 PM

Mac Address



Posted by: Richard Siddaway
Network, PowerShell, WMI

No not where you go for a burger! I saw a post on the forum about getting the MAC address fro remote machines. The original post was using a fixed filter on NetConnectionID which assumes that all of your machines are configured equally. I think a better approach is to gather all the...


August 30, 2013  4:29 AM

Setting an IP address



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

I need to add an IP address to an adapter. I could use the GUI or WMI but with Windows 8/2012 and above I’ve got all of the nifty networking cmdlets to play with. Lets start with finding the adapter to use PS>Get-NetAdapter will show all of the adapters. Unlike ipconfig it only shows...


July 17, 2013  2:05 PM

Internet Connection



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

Can you find the network adapter on your machine that’s connected to the Internet? On a Windows 8/2012 machine its fairly simple: PS> Get-NetConnectionProfile -IPv4Connectivity Internet Name : NetworkName InterfaceAlias : AdapterName InterfaceIndex : 12...


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

			
			
			


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: