Tag: IP Address

VM Network Adapter

PowerShell One-liner to list IP Addresses of Hyper-V Virtual Machines

Here a very quick PowerShell command to list all the Virtual Network Adapters, including IP Addresses of Virtual Machines running on a Hyper-V Host.

This will give you a list of all Virtual Machines running on Hyper-V Server called “HyperV01”



Get-NetIPConfiguration

Basic Networking PowerShell cmdlets cheatsheet to replace netsh, ipconfig, nslookup and more

Around 4 years ago I wrote a blog post about how to Replace netsh with Windows PowerShell which includes basic powershell networking cmdlets. After working with Microsoft Azure, Nano Server and Containers, PowerShell together with networking becomes more and more important. I created this little cheat sheet so it becomes easy for people to get started.

Basic Networking PowerShell cmdlets

Get-NetIPConfiguration

Get the IP Configuration (ipconfig with PowerShell)

List all Network Adapters

Get a spesific network adapter by name

Get more information VLAN ID, Speed, Connection status

Get driver information

Get adapter hardware information. This can be really usefull when you need to know the PCI slot of the NIC.

Disable and Enable a Network Adapter

Rename a Network Adapter

IP Configuration using PowerShell

PowerShell Networking Get-NetIPAddress

Get IP and DNS address information

Get IP address only

Get DNS Server Address information

Set IP Address

or if you want to change a existing IP Address

Remove IP Address

Set DNS Server

Set interface to DHCP

Clear DNS Cache with PowerShell

You can also manage your DNS cache with PowerShell.

List DNS Cache:

Clear DNS Cache

Ping with PowerShell

PowerShell Networking Test-NetConnection Ping

How to Ping with PowerShell. For a simple ping command with PowerShell, you can use the Test-Connection cmdlet:

There is an advanced way to test connection using PowerShell

Get some more details from the Test-NetConnection

Ping multiple IP using PowerShell

Tracert

PowerShell Tracert

Tracert with PowerShell

Portscan with PowerShell

PowerShell Portscan

Use PowerShell to check for open port

NSlookup in PowerShell

PowerShell Networking NSlookup

NSlookup using PowerShell:

Route in PowerShell

PowerShell Networking Route

How to replace Route command with PowerShell

NETSTAT in PowerShell

PowerShell Networking Netstat

How to replace NETSTAT with PowerShell

NIC Teaming PowerShell commands

Create a new NIC Teaming (Network Adapter Team)

SMB Related PowerShell commands

SMB PowerShell SMB Client Configuration

Get SMB Client Configuration

Get SMB Connections

Get SMB Mutlichannel Connections

Get SMB open files

Get SMB Direct (RDMA) adapters

Hyper-V Networking cmdlets

Hyper-V PowerShell Get-VMNetwork Adapter

Get and set Network Adapter VMQ settings

Get VM Network Adapter

Get VM Network Adapter IP Addresses

Get VM Network Adapter Mac Addresses

I hope you enjoyed it and the post was helpful, if you think something important is missing, please add it in the comments.



System Center 2012 R2 Virtual Machine Manager in IPAM

Connect IPAM with System Center 2012 R2 Virtual Machine Manager

In System Center 2012 SP1 Virtual Machine Manager you already had an option to feed information into your IPAM (IP Address Management which was introduced with Windows Server 2012).  In the R2 release of Windows Server 2012 R2 and System Center 2012 R2, Microsoft did enhance the connection between IPAM and Virtual Machine Manager (SCVMM). This was a really important step, because first of all not a lot of people have a real IP Address Management solution like IPAM, most of them are still using some crazy Excelsheets to mange IP Addresses. But if you are thinking about your Private Cloud or you are a Cloud Service Provider this just doesn’t work. IP Addresses these days change rapidly and especially when you do IaaS (Infrastructure as a Service) and you don’t have access inside the VM, because you don’t control it, you need some automated system. IPAM in Windows Server 2012 and Windows Server 2012 R2 is just perfect for that. It integrates in Active Directory, DNS, DHCP and more. With System Center 2012 R2, Virtual Machine Manager gets a perfect connection to IPAM. And if you have worked with Virtual Machine Manager 2012, 2012 SP1 you know that SCVMM knows about all your networks and even your customer networks. VMM is definitely the central management for your cloud environment which offers an end-to-end solution.

To connect and integrate IPAM into SCVMM 2012 R2, open the Virtual Machine Manager console and navigate Fabric and add a new Network Service.

Assign a name to the network service.

Virtual Machine Manager add Network Service

Choose Microsoft Windows Server IP Address Management

Choose Microsoft Windows Server IP Address Management

Enter credentials for the connection between Virtual Machine Manager and IPAM and enter the connection string which is basically the FQDN of the IPAM infrastructure.

Specify network service connection string

You can also validate the network service configuration provider, which will test the connection to the IPAM server.

Validate the network service configuration provider

After you have connected IPAM, the network definitions, VM Networks, Logical Networks, IP Pools and so on will show up in IPAM.

System Center 2012 R2 Virtual Machine Manager in IPAM

I hope more people will see the value of IPAM and the integration in System Center 2012 R2 Virtual Machine Manager.



Replace netsh with Windows PowerShell – Basic network cmdlets

Some days ago I made a blog post about how you can replace diskpart.exe with the new cmdlets in Windows PowerShell v3. Now my next goal was to replace netsh with PowerShell.

Microsoft offers a lot of new cmdlets for networking tasks lets see what we have here. We got a lot of new PowerShell modules which are related to networking.

get-module

Now the two modules which sound really interesting are

lets check which cmdlets are included

net-adpater module

Now lets start with NetAdpater.

List all Network Adapters

get-netadapter

Just list Wireless Network Adapters

get-netadapter wireless

Get more information VLAN ID, Speed, Connection status

get-netadapter information

Get driver information

get-netadapter driver

Get adapter hardware information. This can be really usefull when you need to know the PCI slot of the NIC.

get-netadapterhardwareinfo

Disable and Enable a Network Adapter

disable enable network adapter

Rename a Network Adapter

rename network adapter

Now with the NetTCPIP PowerShell module we can work with IP settings

Get IP and DNS address information

get-ipaddress

Get IP address only

get-ipaddress only

Get DNS Server Address information

get-dnsserver

Set IP Address

or if you want to change a existing IP Address

Remove IP Address

Set DNS Server

Set interface to DHCP

Now with this basic knowledge we can replace some of the basic netsh commands and ipconfig

netsh

Windows PowerShell