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

Notifications

Announcements

Community site session details

Community site session details

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

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,129 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard