7 Replies Latest reply on Aug 19, 2016 10:54 AM by Kenyon

    IP address leading zeros in unattend.xml


      I'm trying to create a provisioning template that will reimage a Windows server and use its existing static IP address in the unattend.xml file. The problem is that LDMS IP addresses are stored with leading zeros, which always (even when entered manually in the unattend.xml file, forgetting LDMS provisioning for a second) yields the wrong value, as I think Windows is interpreting the number as octal.


      The database value that I'm passing as a public variable is "Computer"."Network"."TCPIP"."Bound Adaptor"."IP Address"


      Is there any way around this? Maybe querying another value, or is there a setting to remove leading zeros? From what I've gathered, the behaviour of Windows sysprep handling IP address values can't be changed.

        • 1. Re: IP address leading zeros in unattend.xml

          Forgot to mention, we have to use IPv4 addresses (don't ask me why, it an infrastructure thing!)

          • 2. Re: IP address leading zeros in unattend.xml

            Do you have data analytics available to you? If so, you could use the "map data" rule Computer.Network.TCPIP.Address Unpadded which generates an unpadded version of the IP.


            Alternatively, get a VBS script that will take each part of the ip address and individually strip the lead 0's before then merging ti back together into a single address. This could then replace a generac label in the unattend file.

            • 3. Re: IP address leading zeros in unattend.xml

              Hi Jack, unfortunately, we don't have Data Analytics. I was hoping not to have to resort to further scripting, but if there's no other function within either LDMS provisioning or sysprep parsing, then this might have to suffice. Thanks anyway.

              • 4. Re: IP address leading zeros in unattend.xml
                phoffmann SupportEmployee

                Yeah - sorry - due to historical reasons (I think it had to do with reporting on networks?) we pad the IP-addresses in the databases. Since you're just reading a string out of the DB, you get the padding with it.

                1 of 1 people found this helpful
                • 5. Re: IP address leading zeros in unattend.xml

                  This might be a worth a feature request, I'm surprised it hasn't arisen before. The template in question is for a group of XenApp servers that we intend to replace. We'll probably end up assigning DHCP reservations for their MAC addresses so they only ever get one specific IP address assigned to them, but it would have been nice to keep this automation a little more simple and dynamic within LDMS.

                  • 6. Re: IP address leading zeros in unattend.xml
                    phoffmann SupportEmployee

                    It's one of those "cursed if you do / cursed if you don't" affairs.


                    For "us IT guys" doing the work in the field, unpadded is the way to go.


                    For reports & reporting, padded makes life MUCH easier.


                    So (in the longer run) we ended up with both ... at the moment, you need DA to get the unpadded address as an inventory attribute (not everyone wants/needs them). That may potentially become a standard feature in the future, as DA becomes also much more common place (and it is pretty much commonplace these days in a lot of places).


                    So I suspect "since the option is there", it's not going to see much separate dev time - rather as the product grows & combines more, DA may become part of a more base-line licensing set, potentially (Disclaimed - I've no idea, this is me hoping).

                    • 7. Re: IP address leading zeros in unattend.xml
                      Kenyon Expert

                      It might be possible to use wmic to pull the IP. Something like "wmic NICCONFIG GET IPAddress".


                      Many environments I have worked with have the static IP address assigned at the DHCP level. This not only makes management of the static IPs centralized but eliminates the need to replace the address while provisioning.