PowerShell Script: Calculate First and Last IP of a Subnet

I just wrote this script to calculate the first and last IP of a subnet based on any given IP (within the subnet) and it’s subnet mask:

Syntax: .\Get-NetworkStartEndAddress.ps1 “IP address” “Subnet Mask”

Download here: Get-NetworkStartEndAddress.ps1

One comment

  1. Good script! Thanks for putting it together. We use the first IP for default gateways and this makes automating our IP assignment process much easier.

Leave a Reply

%d bloggers like this: