Skip to content

Powershell function to calculate the ip adderss from a given ip range

License

Notifications You must be signed in to change notification settings

OtterKring/Expand-IPRange

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Expand-IPRange

Calculate all ip addresses for a given IP range

Why ...

You may want to create automation or monitoring scripts for all currently connected machines in your network. Using this function you can easily prepare a list of ip addresses to be checked.

Example:

You want to run a port scan on all machines in your network, e.g. using Patrick Gruenauer's Test-OpenPort.ps1, and your network range is 10.0.0.0/24 (10.0.0.0, Subnet 255.255.255.0):

Expand-IPRange -IPRange '10.0.0.0/24' `
| foreach ( Test-OpenPort -Target $_ -Port 80,443 )

or with more IP ranges and an array:

$IPs = '10.0.0.0/24','192.168.0.0/27' | Expand-IPRange
Test-OpenPort -Target $IPs -Port 80,443

Have fun and happy coding! Max

About

Powershell function to calculate the ip adderss from a given ip range

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published