5 Replies Latest reply on Sep 29, 2018 1:18 AM by Rick.Smith1

    Computer Naming Template Help

    paypwip Rookie

      Hoping someone can make this simple for me. We are looking at Upgrading a few thousand computers OSs and I don't want to have to have a technician there to type in the name, but the OS Version is part of the naming convention as is the machine type.

       

      Our Naming convention is a two digit site code, OS Version Code, Computer Type, Asset Tag Number. i.e. 02WTD12345 would be Site 02 Windows Ten Desktop Asset Tag 12345

       

      So down to the questions...

       

      1) What do I have to do in the provisioning template to have it change the Site Code based on the Network the computer is being imaged on? i.e.. Site 02 IP = 02 in the computer name

      2) Insert WTD in the Name for Windows 10 Images on desktops, WTL for laptops

      3) What Naming Template Magic can I use to trim off all but the last 5 Digits of the Computer Name and then reuse them as the end of the new computer name

       

      Thank you in advance for your help,

       

      Erik

        • 1. Re: Computer Naming Template Help
          JoeDrwiega SupportEmployee

          I would use conditional variables described here: How to use Conditionals in LANDESK 2016 Provisioning and if you are just re-imaging described here: How to maintain Device Name after Re-Imaging

          • 2. Re: Computer Naming Template Help
            karlehenry Apprentice

            You also would want to setup and configure the device name prompter.  you can do EXACTLY What you are looking for using variables from the inventory database.  This does get tricky with devices not in the database, but you can use bare metal provisioning to pre-populate new machines. new machines.

             

            Here is a quick start guide to get you started:

            https://community.ivanti.com/docs/DOC-34182

             

            Let us know if you need any more help.

            • 3. Re: Computer Naming Template Help
              paypwip Rookie

              A little more help here. I like the idea here How to maintain Device Name after Re-Imaging for if it has no name assigned do A else do B.

               

              I'm running into the need to nest If Else statements though.

               

              First determine what site it's on Determined by IP (Database Variable but need to check Multiple Subnets per site) i.e. 192.168.2.x OR 192.168.3.x = Site 02 ; 192.168.4.x = Site 03 ; 192.168.5.x OR 192.168.6.x = Site 04 etc.

              Which OS is determined by the Image Chosen, so for now WT for Windows 10

              Then what Chassis type it is (Database variable got that) i.e. If laptop Put an L in the Name, If desktop put a D in the name

              Then Trim to the last Five of the Existing Computer Name (Asset Tag #) 12345

              Then we know Site + OS( Known B/c Image Applying) + Chassis Code +  Asset Tag i.e. 02WTD12345 Is Site 02, Windows 10, Desktop, Asset Tag 12345

               

              How do I put it all together and nest all the if else statements??

               

              Thank you

              • 4. Re: Computer Naming Template Help
                karlehenry Apprentice

                Definately seems like a challenge.  but simply put....

                 

                you can have nested if statements and processes down:

                 

                So im not sure the best route to take but lets try:

                 

                If Subnet X

                     if laptop

                          if windows X

                               if laptop

                               if desktop

                                    do Device Name with format desired

                          if windows y

                               .....

                          If Windows z

                               ......

                If Subnet y

                          ...........

                 

                 

                 

                So basically, start with the 1st subnet, then go down and right a condition for each and then narrow it down.  Then when you ge tto the DO part, you run device name prompter and have it fill in.

                 

                I would suggest test with the 1st subnet, then all you need to do is really copy and paste and repeat everything for each additional.

                 

                Also, we can set this up with individual templates and just use includes to make it easier possibly.

                 

                If you would like me to be more detailed, I can put together some screens hots and share with and if others have a better way, I am sure they will chime in.

                • 5. Re: Computer Naming Template Help
                  Rick.Smith1 Expert

                  paypwip

                   

                  Something we do similar to what you are asking seems like it would work. For devices that we image, I run a custom exe I built with AutoIt. The EXE simply gets executed during the provisioning process. What it does is that IF a device record already exists in the EPM records, it will re-use that name automatically... great for re images in our case because our devices always just use the asset tag as the device name nothing more.

                   

                  If no record is found, it will prompt the user for a name, just like the built in name prompter.

                   

                  Another check we built in was to validate that the name fit our naming standards. if it did not, the analyst would get prompted to confirm that the non-standard name which was found in EPM was a legitimate name they wanted to use. So there is a bit of a built in sanity check.

                   

                  I see your request being able to leverage this same process. The difference is that you are upgrading a number of devices. All your current devices have a record like 02W7D12345 and you need to reimage and rename it to 02WTD12345 dynamically.

                   

                  Since this is all you are doing, you would just get the existing name and do a substitution where it was required.

                   

                  I'd have to look at my code, I built it a number of years ago back in the LDMS 9.x days and it still works great, but you could easily extend it to even make it more dynamic so that in your provisioning template you just pass into it an OS code other than "T" and it will substitute it out. Granted, per MS Windows 10 is the last and ultimate OS never to see an 11, but who knows.

                   

                  At any rate, I am not sure the built in pre-existing stuff will get you 100% where you are looking to be, which is to simply substitute a single character in the middle of the name upon reimage.

                   

                  Looking back at your full request in light of what I just wrote:

                   

                  1) What do I have to do in the provisioning template to have it change the Site Code based on the Network the computer is being imaged on? i.e.. Site 02 IP = 02 in the computer name

                  Easy... adjust my code to read in the parameters you passed into the exe. You could set this in the provisioning template and have that site execute it. OR put into the EXE the list of IPs you want to validate as site 01, 02, etc. I don't know how often you will be changing this, so it really comes down to where would you want to manage this, either in the EXE or with multiple provisioning scripts. I'm a bit old school so not sure if the newer If\Then stuff in provisioning would work. I assume if it is 02 now, it would be 02 in the reimage, but I dont know if you are actually reimaging at a new site or what.

                   

                  2) Insert WTD in the Name for Windows 10 Images on desktops, WTL for laptops

                  Same as above, either dynamically insert or insert based on existing records. i assume if you existing record is a W7D or W7L, it could easily carry through with the dynamic substitution idea.

                   

                  3) What Naming Template Magic can I use to trim off all but the last 5 Digits of the Computer Name and then reuse them as the end of the new computer name

                  If the last 5 digits are the asset tags, then these I assume would be static and carry over. So you wouldn't want to just trim it per say. You want to just substitute out your OS variable.

                   

                  Hope that provides some ideas.

                  Rick