web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parse IP Range - Exter...
Power Automate
Answered

Parse IP Range - External library

(0) ShareShare
ReportReport
Posted on by 2
Hi forum,

Please help me solve the problem here. I need to parse a range of IP into a List of IPAddress for example the input was "192.168.1.1-192.168.1.10" and the expected result was:
["192.168.1.1",
 "192.168.1.2",
 "192.168.1.2",
  .....
 "192.168.1.10"]

I'm using external library in VB.Net script called "IPAddressRange" but it keep gives me an error. 
 
I have tried adding reference ".dll" file of the external library, but still it didn't work. Please help me solve this issue or give any other alternative. Thanks
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi, I think you need to add system.net.primitives dll file as well.
     
    But i think you can try below expression as well if needed
     
    Dim startIP As String = in_InputIPAddress.Split("-")(0)
    Dim endIP As String = in_InputIPAddress.Split("-")(1)
    Dim startAddress As IPAddress = IPAddress.Parse(startIP)
    Dim endAddress As IPAddress = IPAddress.Parse(endIP)
    
    Dim currentIP As Byte() = startAddress.GetAddressBytes()
    Dim endIPBytes As Byte() = endAddress.GetAddressBytes()
    
    Dim ipList As New List(Of String)
    
    ' Loop until we reach the end IP
    Do
        ipList.Add(String.Join(".", currentIP))
    
        ' Increment the IP address
        For i As Integer = currentIP.Length - 1 To 0 Step -1
            currentIP(i) += 1
            If currentIP(i) <> 0 Then Exit For
        Next
    Loop While Not currentIP.SequenceEqual(endIPBytes)
    
    ' Add the last IP in the range
    ipList.Add(endIP)
    out_IPAddressList=ipList
     
    Also these dll is requred
     
     
    Also following are the variables types used in run .net script
     
     
    This is the flow designed
     
    Output
     
    Hope it helps !
     
    Thanks & Regards,
    Nived N

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 484

#2
11manish Profile Picture

11manish 282

#3
David_MA Profile Picture

David_MA 280 Super User 2026 Season 1

Last 30 days Overall leaderboard