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

    Early HostnameChanger

    Scheduled Pinned Locked Moved
    General
    3
    16
    4.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.
    • adukes40A
      adukes40 @george1421
      last edited by

      @george1421 nah, the unattend doesn’t touch the hostname.

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @adukes40
        last edited by

        @adukes40 OK in your unattend.xml file there isn’t a hostname section or if there is it contains a star ( * )?

        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!

        adukes40A 1 Reply Last reply Reply Quote 0
        • adukes40A
          adukes40 @george1421
          last edited by

          @george1421 Without looking I do not know for certain. But now that you say it I think it is just an * which is why it names it TECHNOL-blahblah

          1 Reply Last reply Reply Quote 1
          • adukes40A
            adukes40
            last edited by

            just verified that for you. indeed:

            <ComputerName>*</ComputerName>

            Wayne WorkmanW 1 Reply Last reply Reply Quote 0
            • Wayne WorkmanW
              Wayne Workman @adukes40
              last edited by

              @adukes40 I did a little Google searching on that, that line does set a generic name.

              Seems it’s un-doing the Early Hostname Changer’s work perhaps?

              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!
              Daily Clean Installation Results:
              https://fogtesting.fogproject.us/
              FOG Reporting:
              https://fog-external-reporting-results.fogproject.us/

              adukes40A 1 Reply Last reply Reply Quote 1
              • adukes40A
                adukes40 @Wayne Workman
                last edited by

                @Wayne-Workman seems very plausible. I will update the image to remove the setting from the xml tomorrow.

                Is that where you were going with the (*) George? the unattend overwriting the EHNC?

                george1421G 1 Reply Last reply Reply Quote 0
                • george1421G
                  george1421 Moderator @adukes40
                  last edited by george1421

                  @adukes40 yes, that what ever was in the unattend.xml file is overwriting the registry. That sounds logical to how a sysprep’d image would work.

                  One might think that the following sed magic would change that computer name * to something FOG could manage. Where $unattendfile would be the full path and file name of the unattend file. One could slide that in a existing post install script or make a new one call fog.sethostname. Then you wouldn’t need the fog set host function at all.

                   sed -i -e "s#<ComputerName>\([^<][^<]*\)</ComputerName>#<ComputerName>$hostname</ComputerName>#gi" $unattendfile
                  

                  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!

                  Wayne WorkmanW 1 Reply Last reply Reply Quote 3
                  • Wayne WorkmanW
                    Wayne Workman @george1421
                    last edited by Wayne Workman

                    @george1421 I’m not a sysprep person, is the unattend.xml file located in the same spot across different versions of Windows? Maybe this could be a feature in the fog inits? It could be a checkbox like the early hostname changer is. Just a general global setting that is on or off, and looks for this unattend file and makes changes if it’s found.

                    I imagine a whole lot is possible now in the realm of unattend.xml via BASH with those variables you exposed.

                    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!
                    Daily Clean Installation Results:
                    https://fogtesting.fogproject.us/
                    FOG Reporting:
                    https://fog-external-reporting-results.fogproject.us/

                    george1421G 1 Reply Last reply Reply Quote 0
                    • george1421G
                      george1421 Moderator @Wayne Workman
                      last edited by george1421

                      @Wayne-Workman For the sysprep unattend.xml file it is typically in 2 or 3 spots. The reference image creator can really put it anywhere the OOBE installer can find (on the local system). But it is typically in c:\windows\sysprep or c:\windows\panther.

                      Today I have unattend.xml set the system name with the below sed script, it also sets the timezone, AD OU, keyboard, region, and a few other things. All by patching the the unattend.xml file with sed and a few semi intelligent scripts.

                      For clarity the sed script for setting the host name will work today (yesterday) before the hostinfo.php script was included in the FOG base code. But now that it can be called there are more interesting things that can be done with the unattend.xml file.

                      You don’t need to use an unattend.xml file with sysprep so assuming there will always be one may fail. That is why I assume the fog client updates the registry to make the change (because not everyone uses sysprep and the unattend.xml file). Along the same lines when I get back to work I need to find out why a windows 10 system is not using a predefined unattend,xml file. There has to be a registry entry somewhere that tells it where the unattend.xml file is. There is one in the image, its just not using it for some reason. If I can find out why this win10 unattend.xml file isn’t being use I may be able to feed that info to the devs to help with the name changer function. At this point I don’t want to think too much about next week.

                      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!

                      1 Reply Last reply Reply Quote 1
                      • adukes40A
                        adukes40
                        last edited by adukes40

                        OK, so I ended up bypassing the HNC and EHNC all together. Being we need a reboot to occur before joining the domain, I created a powershell script to run on that first auto logon to take care of the name change. So the unattend names it with the * variable, then PS runs and pulls the current computer name, the asset from the bios, and serial from the bios and mashes them together and is working perfectly. Here is the script if it helps someone else gets started with their PS script:

                        #Rename the Workstation
                        $CurrerntComputerName = (Get-WmiObject -Class Win32_ComputerSystem -Property Name).Name
                        $SerialNumber = (Get-WmiObject -Class Win32_BIOS | Select-Object SerialNumber).SerialNumber
                        $AssetTag = (Get-WmiObject -Class Win32_SystemEnclosure | Select-Object SMBiosAssetTag).SMBiosAssetTag

                        $OSDComputerName = “$($AssetTag)-$($SerialNumber)”

                        Rename-Computer -ComputerName $CurrerntComputerName -NewName $OSDComputerName

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

                        197

                        Online

                        12.1k

                        Users

                        17.3k

                        Topics

                        155.4k

                        Posts
                        Copyright © 2012-2024 FOG Project