title: How to get IP Address range from subnet and netmask
body: <p>Team,</p>
  
  <p>I am new to the forum, also new to the development, i am currently using windows 2016, 2012 &amp; 2008 servers in the environment. The script primarily should work on all the environment.
  I wanted to find out the IP start ip address and end ip address.</p>
  
  <pre><code>$params = @{
    "ComputerName" = "."
    "Class" = "Win32_NetworkAdapterConfiguration"
    "Filter" = "IPEnabled=TRUE"
  }
  $netConfigs = Get-WMIObject @params
  foreach ( $netConfig in $netConfigs ) {
    for ( $i = 0; $i -lt $netConfig.IPAddress.Count; $i++ ) {
      if ( $netConfig.IPAddress[$i] -match '(\d{1,3}\.){3}\d{1,3}' ) {
    $ipString = $netConfig.IPAddress[$i]
    $ip = [IPAddress] $ipString
    $maskString = $netConfig.IPSubnet[$i]
    $mask = [IPAddress] $maskString
    $netID = [IPAddress] ($ip.Address -band $mask.Address)
    "IP address: {0}" -f $ip.IPAddressToString
    "Subnet mask: {0}" -f $mask.IPAddressToString
    "Network ID: {0}" -f $netID.IPAddressToString
      }
    }
  }
  </code></pre>
  
  <p>Convert IP address to the subnet
  [IPAddress] (([IPAddress] "192.168.100.45").Address -band ([IPAddress] "255.255.255.0").Address)</p>
  
  <p>I am currently using 2016 &amp; i am not getting how to proceed further to get the start ip address and end ip address in a single line of code.
  Please advise</p>