9 Replies Latest reply on Jan 22, 2016 7:36 AM by MarXtar

    Add location name for PC's in LANdesk

    Rookie

      Hi,

       

      We have recently installed and rolled out LANdesk across our network after moving from another Product.

       

      the only problem we have at the minute is knowing where a PC is within the network due to the size of our network and IP ranges this means we have to resort to finding the default gateway in a spreadsheet.

       

      now is it possible to add in a custom field to LANdesk inventory and then depending on what that Default Gateway is populate it with a branch name.

       

      I'm aware this may take a little bit to setup but would help our service desk and others on where a PC is within the company.

       

      Cheers,

        • 1. Re: Add location name for PC's in LANdesk
          MarXtar ITSMMVPGroup

          If you have the Data Analytics module then this is one of the things this can do with the Data Translation Rules.

           

          If you don't then the only way to do this is to build queries that would select systems based on their gateways or IP ranges. This won't change the inventory record so you can't tell from within the inventory of the machine itself.

           

          Mark McGinn

          MarXtar Ltd/MarXtar Corporation

          http://landeskone.marxtar.co.uk

          LANDESK One Development Partner

           

          The One-Stop Shop for LANDESK Enhancements

          • 2. Re: Add location name for PC's in LANdesk
            steve.may Apprentice

            You could probably script something to have the info added to custom data in inventory.  I've done something similar using a powershell script and pushing it out via a distribution package.

            • 3. Re: Add location name for PC's in LANdesk
              Apprentice

              We have been doing this manually, it is a slow process with a lot of PCs, but it is simple and it works. On the endpoint itself under Computer Description in Windows we put the location. This field you can have show up under Network View on the Management Console so it is very convenient once done.

              • 4. Re: Add location name for PC's in LANdesk
                john.kirkland Rookie

                Since our institution uses the Dell service tag as the computer name, we faced this problem as well. What we decided to do was, for new PC's being deployed we would use the "Computer Description" field in Computer Properties on the machine itself to enter the site, building, and office number as part of our setup process (Right-click Computer->Properties->"computer description"). Then in Landesk we added a column for Computer.Description in our column set so we can easily identify it. For existing PC's we simply wait until it becomes necessary to remote into that machine or physically touch it, then while we're there we take the opportunity to set the Computer Description field.

                • 5. Re: Add location name for PC's in LANdesk
                  Apprentice

                  Yes, this is exactly how we are doing it as well.

                  • 6. Re: Add location name for PC's in LANdesk
                    Rookie

                    Looking about after some of the suggestions, looks like we may have to go along the lines of what steve.may suggested. unfortunately the 4 of us that deal with the imaging and remote controlling will be a no go from management here as there are about 4000 PC's and they are looking to get this out sooner rather than later due to an update we are looking at.

                     

                    what i might do is arrange for a script to be run on group policy for the branch name (this can then at least update when a user goes to another branch on a laptop or when the PC is moved to another location) it also allows for a naming convention to be stuck to as people wont always stick to them. after that has been added i can look at getting the data that has been added to the PC's to be inventory scanned by LANdesk and added to the inventory.

                    • 7. Re: Add location name for PC's in LANdesk
                      steve.may Apprentice

                      You can use miniscan.exe on the client in your script to send the custom data back to the core and add it into inventory.  You'll just need to make sure you go into your inventory service and allow the Unknown Item(s) you want added to inventory.

                      • 8. Re: Add location name for PC's in LANdesk
                        Rookie

                        Cheers steve.may and everyone else actually for the suggestions

                         

                        should probably add had been looking at this - How to extend the Inventory Scanner capabilities

                        • 9. Re: Add location name for PC's in LANdesk
                          MarXtar ITSMMVPGroup

                          Here is a potential way of doing what you want with vbscript:

                           

                          Option Explicit
                          Dim Location
                          Dim objWSHShell : Set objWSHShell = WSCript.CreateObject("WScript.Shell")
                          ' ** TOP LEVEL CODE ** '
                          Select Case DefaultGateway
                              Case "172.168.0.1"
                                  Location = "There"
                                  Wscript.Echo Location
                              Case "192.168.0.1"
                                  Location = "Here"
                                  Wscript.Echo Location
                          End Select
                          objWSHShell.RegWrite "HKLM\SOFTWARE\WOW6432Node\Intel\LANDesk\Custom Fields\SiteName", Location, "REG_SZ"
                          ' ** Functions and SubRoutines **'
                          Function DefaultGateway()
                              DefaultGateway = Empty
                              Location = Empty
                              Dim objWMI : Set objWMI = GetObject("winmgmts:\\.\root\cimv2")
                              Dim oDGs : Set oDGs = objWMI.ExecQuery _
                              ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
                              Dim oDG
                              For Each oDG in oDGs
                                  If Not IsNull(oDG.DefaultIPGateway) And Not oDG.defaultIPGateway(0) =  "0.0.0.0" Then
                                      DefaultGateway = oDG.DefaultIPGateway(0)
                            Wscript.Echo DefaultGateway
                                      Exit For
                                  End If
                              Next
                          End Function
                          
                          

                           

                          This can be modified to set a location name depending on which default gateway is found. Note that if there is more than one that matches the last one in the case statement will be used.

                           

                          The reg key it writes to will automatically be picked up by the inventory scanner. You will need to go into Configure Services - Inventory - Unknown Items to approve the field you use to enter the database.

                           

                          If you had this set to run as a locally scheduled task attached to an IP address change then it it could update each time the machine moves. You could even potentially modify the script to call the inventory scanner (being careful of the potential load though).

                           

                          This is provided 'As-Is' - I've done some VERY basic manual testing on my machine to make sure it selected something and wrote to the key. Hopefully this gives you something to go on.

                           

                          Mark McGinn

                          MarXtar Ltd/MarXtar Corporation

                          http://landeskone.marxtar.co.uk

                          LANDESK One Development Partner

                           

                          The One-Stop Shop for LANDESK Enhancements