HostnameChanger Issue



  • We DO NOT use Fog to join domain, however we use it to rename the PC to what we register the host as…

    Our process is this:

    Network boot, and choose “Full registration” we enter the Name we want the PC to be, then choose the image and etc… after the registration finishes and it is set to deploy the image, we network boot again, and the image is deployed…

    Now, during our 1st login of the administrator account we get a few things configured via the SetupComplete.cmd as well as a .bat file with the ending result being the Fog service being enabled, and the PC getting rebooted…

    The PC then auto logins in to windows, in the past the PC would automatically reboot and the PC would get the name changed via FOG client…

    Seems that if the check box is not checked under the individual Host called “Name Change/AD Join Forced reboot?” listed under the Active Directory section of the Host… the Fog client gives this error in the log:

    --------------------------------HostnameChanger-------------------------------
    ------------------------------------------------------------------------------
     10/9/2020 9:24:59 AM Client-Info Client Version: 0.12.0
     10/9/2020 9:24:59 AM Client-Info Client OS:      Windows
     10/9/2020 9:24:59 AM Client-Info Server Version: 1.5.9
     10/9/2020 9:24:59 AM Middleware::Response Success
     10/9/2020 9:24:59 AM HostnameChanger Users still logged in and enforce is disabled, delaying any further actions
    

    However if I manually check this check box “Name Change/AD Join Forced reboot?” within the Host Active Directory settings the PC reboots and gets renamed etc…

    How can this setting be checked by default when a Host is registered?

    I see a setting under “Fog Settings” in the “Active Directory Defaults”
    named “ENFORCE HOST CHANGES” and it is checked… as well as under “Fog Client - Hostname Changer” a setting “CLIENT HOSTNAMECHANGER ENABLED” that is also checked…

    As well as “CLIENT TASKREBOOT ENABLED” and “TASK FORCE REBOOT” under “FOG Client - task Reboot” also being checked…

    But the setting under the individual Host, in the Active Directory section named “Name Change/AD Join Forced reboot?” is NOT checked by default… and this is what stops the PC from being renamed if the computer has a user logged in…

    Does anyone know how to set the “Checked” as default on new Host registration??

    Thanks

    Jason


  • Senior Developer

    @jtappen The picture you posted, is this in Hosts -> edit one host’s settings -> Active Directory or in Groups -> edit group settings -> Active Directory?

    If it’s the host’s settings then we can start digging deeper by looking into the database:

    shell> mysql -u fogmaster -p
    Password:
    ...
    mysql> use fog;
    ...
    mysql> SELECT hostName,hostEnforce FROM hosts WHERE hostName LIKE '%newhostname%';
    ...
    mysql> SELECT settingValue FROM globalSettings WHERE settingKey LIKE '%FOG_ENFORCE_HOST_CHANGES%';
    ...
    mysql> quit
    

    The password for the fogmaster database user is found in /var/www/html/fog/lib/fog/config.class.php. Instead of newhostname in the SQL query put in the name of the host you just registered - make sure the case is correct! Post output of the commands here in the forum if you need further help.



  • @Sebastian-Roth
    Thanks for the reply… sorry I have not responded until now…
    Yes we are using 1.5.9

    When we do a full registry of a new device through the fog network boot, then if I go in and look at the settings for that device the check box for Name Change/AD Join Force reboot is NOT checked…
    And I have no idea what needs to be adjusted within the fog configuration to make this check box be checked by default on ALL new registered devices…

    18957893-ba74-4fab-99d6-7c74feadbcda-image.png

    Any further info would be appreciated

    Jason


  • Senior Developer

    @jtappen Seems like you are using FOG 1.5.9 from the fog-client log you posted. I just tested a full client registration through PXE and it got the “Name Change/AD Join Forced reboot?” checked just fine.

    The only difference I see so far is that I did not let it do a deploy directly and I don’t have the fog-client installed on that test setup so I can’t actually see if it would work. But in the host settings in the web UI I see the field being checked and I would suspect it to work.

    So to me it seems as there is no bug and it works as expected. Can you see anything I might be doing different than you do?


  • Senior Developer

    @darkxeno said in HostnameChanger Issue:

    Error multiple hosts returned for list of mac addresses

    This is the issue you have and it’s very different from what was initially asked in this topic. Please don’t hijack other peoples topics but open you own new one and post details there. If you like we can move the information posted here over the the new topic or you can just copy&paste the text over - as you like.

    Edit: I just remembered you had a topic opened but deleted it. So I just re-opened it and moved all the things over: https://forums.fogproject.org/topic/14827/unable-to-rename-join-error-multiple-hosts-returned-for-list-of-mac-addresses


  • Senior Developer

    @jtappen While I have not looked into this yet I can imagine this being a bug somewhere in the code. From what you described to far it looks like the “Active Directory Defaults” are not making it through. We’ll take a look at this.

    Which version of FOG do you currently use?


Log in to reply
 

260
Online

7.5k
Users

14.6k
Topics

137.6k
Posts