locked
TMG 2010 Tool creating Negative IP octets RRS feed

  • Question

  • Posted this on the MS Download site:

    text file created with msdetotext.vbs TMG tool on a IPv4 infrastructure TMG 2010 sp1, running on a W2k8 sp2 machine creates negative IP address octets. I am sure there is a better fix but this works for me.

     

    See function update to fix negative IP octets

     

    Private Function IPFromDbl(rowValue)

        Dim ipDouble         ' Double

        Dim dot              ' string

        Dim count,octet      ' integers

     

        ipDouble = CDbl(rowValue)

    '   Add one for first Octet - tjea 08/13/2010

        ipdouble = ipdouble + 1 

        IPFromDbl= ""

        dot = ""

        For count = 1 To 4

            ipDouble = (Fix(ipDouble)) / 256

    '    Add 255 because number is negative - tjea 08/13/2010

            octet = 255 + (256 * (ipDouble - Fix(ipDouble))) 

            IPFromDbl = CStr(octet) & dot & IPFromDbl

            dot = "."

        Next

     

    End Function

     

     

     

    Friday, August 13, 2010 10:25 PM

Answers

  • Hi,

     

    Thank you for the post and sharing.

     

    As this issue may related to script and program.  It is recommend you get further support in our MSDN forum. The engineers and community members there have more experience and can help you in a more efficient way.

     

    MSDN Forum

    http://social.msdn.microsoft.com/forums/en-US/categories/

     

    Regards,


    Nick Gu - MSFT
    Wednesday, August 18, 2010 5:32 AM
    Moderator