• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    MAC address as host name - auto populate, etc.

    Scheduled Pinned Locked Moved
    FOG Problems
    4
    26
    13.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Tom ElliottT
      Tom Elliott
      last edited by

      [quote=“rhythmtone, post: 29653, member: 57”]Tom,
      I’m sure that you are super busy but I would kind of like to revisit this. Would it be possible to make a similar modification so I can have “System Serial” as a variable in the quick registration process?

      HP’s are a bear, but for Dell’s this would be so sweet as the “System Serial” is only 7 characters. So the end result would be:

      SITE-ROOM-*

      Where * is the “System Serial” variable that the FOG registration collects.

      Thanks for any advice or input (MAYBE I could try to do it myself), you’re the best,
      D.L.

      PS - This is probably asking a lot, but maybe it could be truncated to 7 characters. Then it would work perfectly with Dell’s, and might work okay with other manufacturers…[/quote]

      The only problem I foresee with adding this is that it’d be either all or none. Meaning, I could add an identifier for SERIAL in the naming convention that get’s automatically changed to the SERIAL of the host being added. I could even add a modifier that replaces any instance of the word SERIAL with the Host’s serial number. That being said, we’ve got truncation added to the init that truncates the hostname to 15 characters which is the limit windows can handle. Where the problem comes in is if somebody wants the naming convention to be SERIAL-14, SERIAL-16.

      This isn’t “that” difficult of a thing to add, but it’s also no simple manner. With the MAC naming system it was easy because the MAC was already being sent to perform the registration. The serial number, on the other hand, isn’t received or stored until after the host is registered, which means the name is already set. That being said, the beauty that is iPXE already has support to receive the systems serial, so I could actually pass the system’s serial number with the kernel arguments and be on our way to having this support. Where it becomes a problem is that serials aren’t standardized to a specific limit. While it would work beautifully on Dell systems, it will fail miserably on other systems.

      I’ll try to take a look into this when I get home though as I’m sure others may want this functionality as well.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      1 Reply Last reply Reply Quote 0
      • R
        rhythmtone
        last edited by

        Thank you for your time thinking this through!

        I had not thought about the issues that you mention, you are definitely right that it is more complicated than it seems at first.

        I guess even Dells would only allow 8 characters in the “prefix” to stay within the 15 character hostname limit :

        SSS-RRR-*

        And you make a good point that since it is not standardized, it would fail on many systems - ACER, and ASUS come to mind as their serials are 30 or so characters with the first 22 or so being the same, by model. The HP’s that I use have 10 characters in the serial, which would still work, but then that limits the prefix as it could no longer be 8 characters. However, I know that many folks just use SSS-* (where SSS is the site, and * would be the serial) and in this case something like this would support all Dells, and I believe all HPs.

        Since it is not standardized, and would probably require truncation then perhaps it would be more trouble than it is worth, but I just wanted to ask about this.

        Although it would be confusing, since FOG allows duplicate hostnames (and only really cares about the MAC) having truncated serials that result in duplicate hostnames would not be the end of the world, until you wanted to join / integrate Active Directory, just a thought.

        Maybe this isn’t something that would be part of the main release but could be a modification, plug-in, etc. because it is complicated, and some folks might actually hate this…

        Thanks again Tom, you’re the man!
        D.L.

        1 Reply Last reply Reply Quote 0
        • R
          rhythmtone
          last edited by

          Another thought, although probably even more complicated, would be to pass the system serial into “Computer Description” inside Windows which allows up to 1024 characters, I believe. I now have a better understanding of the pitfalls and cumbersome nature of having the serial as the hostname, so perhaps this would be an alternative to make the serial view-able and searchable inside Active Directory.

          The goal of this is to be able to cross-reference the systems that FOG has touched inside Active Directory (by more than just a hostname), and passing the system serial to “Computer Description” might be a more elegant or alternative way of doing this. Originally I went down the MAC path because that accomplishes this to a certain level, but that has its downside too.

          Your time, work, and thoughts are greatly appreciated,
          Thanks again,
          D.L.

          1 Reply Last reply Reply Quote 0
          • R
            rhythmtone
            last edited by

            I realize that it would be necessary to modify the FOG Service to do the “Computer Description” idea, but in theory the code/connections are already somewhat setup for something like that, correct?

            Can the FOG Service pull the serial from the SQL database? My guess would be yes, and then it would be a (not simple) matter of passing that into “Computer Description” - after that, the serial would appear inside Active Directory in quite an elegant way.

            Thanks,
            D.L.

            1 Reply Last reply Reply Quote 0
            • JunkhackerJ
              Junkhacker Developer
              last edited by

              if your goal is to retrieve the serial number and set that to the description, you could just do that with a vbscript based snapin

              signature:
              Junkhacker
              We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

              1 Reply Last reply Reply Quote 0
              • R
                rhythmtone
                last edited by

                Thanks for the reply,
                It seems like putting the serial in “Computer Description” might be better than trying to put it in the hostname, so I guess that would be my goal, yes. In simpler terms, getting the serial into Active Directory in some form is the MAIN goal, and “Computer Description” would seem to be the best and more appropriate place/way for this, rather than the hostname.

                The problem with doing it via VBScript snapin is that is another thing to write/manage/push/worry about, and I would rather just have it be mechanized as part of the FOG Service. However, I will certainly try it that way as time allows.

                Would a VBScript pull the serial from the SQL database, or from the local machine? Off the top of my head, I cannot remember if Windows stores the motherboard serial somewhere, but you would think so…

                Also, cloning machines with/without sysprep might cause a VBScript to pull an incorrect serial if it’s pulling it from the local machine.

                Thanks,
                D.L.

                1 Reply Last reply Reply Quote 0
                • C
                  Cory Landry
                  last edited by

                  We implemented this last year so some of the information may have been changed with out being documented, but this is the script we used. Keep in mind this only updates the description in AD not on the computer itself.

                  You also have to change ad permissions.

                  Open ADUC
                  Right click on domain select properties -> security -> advanced -> add
                  Type Authenticated Users -> OK -> properties
                  Change [U]Apply to:[/U] to [U]Descendant Computer Objects[/U] and allow Write Description

                  [CODE]DIM objSysInfo, objWMI, objComputer
                  SET objWMI = GetObject(“winmgmts:{impersonationLevel=impersonate}!\.\root\cimv2”)

                  'Get OU
                  SET objSysInfo=createobject(“adsysteminfo”)

                  'Set computer description; will not update field if description is current or if it starts with an “!”
                  FOR EACH objSMBIOS IN objWMI.ExecQuery(“Select * from Win32_SystemEnclosure”)
                  serviceTag = replace(objSMBIOS.SerialNumber, “,”, “.”)
                  manufacturer = replace(objSMBIOS.Manufacturer, “,”, “.”)
                  NEXT
                  FOR EACH objComputer IN objWMI.ExecQuery(“Select * from Win32_ComputerSystem”)
                  model = trim(replace(objComputer.Model, “,”, “.”))
                  NEXT
                  SET objComputer = GetObject(“LDAP://” & objSysInfo.ComputerName)
                  newDescription = “(” & serviceTag & " / " & model & “)”
                  IF NOT objComputer.Description = newDescription AND NOT left(objComputer.Description,1) = “!” THEN
                  objComputer.Description = newDescription
                  objComputer.SetInfo
                  END IF[/CODE]

                  1 Reply Last reply Reply Quote 0
                  • JunkhackerJ
                    Junkhacker Developer
                    last edited by

                    you might find this link interesting [url]http://deployhappiness.com/find-serial-numbers-in-active-directory/[/url]

                    signature:
                    Junkhacker
                    We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

                    1 Reply Last reply Reply Quote 0
                    • R
                      rhythmtone
                      last edited by

                      Thanks for the replies,
                      These are both good directions to point, and thank you for the suggestions. If/when I have time to try these, I will…

                      However, it would still be better if it was integrated as part of the FOG Service, or the main FOG installation, IMHO. Of course this will sound lazy, but having the work already done and having it mechanized, automated, and in the background is always better.

                      That it probably the single greatest thing about FOG and the FOG Service, it WORKS - yes, there are ways to do everything that FOG and the FOG Service do independently, on your own, but I would never be able to get them working. The deployhappiness.com link illustrates this perfectly as the comment section is full of folks having trouble with it, trying to get it to work, etc. and undoubtedly that would be me as well and I would probably just give up before I got it working…

                      That’s why you guys are developers and I’m just a user, haha!

                      Thanks again for all of your work and help,
                      D.L.

                      1 Reply Last reply Reply Quote 0
                      • R
                        rhythmtone
                        last edited by

                        I just wanted to add that I do understand that basic scripting is not the same as developing, and is generally part of the job, but I’m sure that I will have some trouble getting this to work.

                        I will try it and report back, thanks again for all of the assistance and the great work on FOG,
                        D.L.

                        1 Reply Last reply Reply Quote 0
                        • Tom ElliottT
                          Tom Elliott
                          last edited by

                          If you need help, Convo me (not everybody all at once), but I can try to assist and direct where you may need it.

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          1 Reply Last reply Reply Quote 0
                          • 1
                          • 2
                          • 2 / 2
                          • First post
                            Last post

                          244

                          Online

                          12.0k

                          Users

                          17.3k

                          Topics

                          155.2k

                          Posts
                          Copyright © 2012-2024 FOG Project