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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: