Computers Join Domain before Hostname Changes



  • As the title says, our computers are joining our domain before the hostname is changed. I assume that’s what’s happening because the default Windows 10 names of “DESKTOP-XXXXXX” are appearing in mass under our default computers OU. After the Fogservice is done doing its stuff and correctly renames the machine, the previous names (DESKTOP-XXXXXX) are shown as disabled in the OU, while the proper hostname appears.

    Is there a way to set the order of how the Fogservice performs its tasks?

    EDIT: This issue only happens sometimes. I just imaged four machines, all of which joined the domain, but only two showed with the DESKTOP- hostnames.



  • Thanks, Wayne!


  • Moderator

    The OP’s problem can likely be solved by following instructions in the wiki for using the new fog client with sysprep (link below), additionally FOG Client 0.11.5 has additional code to detect if sys-prep stuff is happening now, so that would help too. The latest FOG Client comes with the latest FOG, so if you don’t have 0.11.5, you need to upgrade your fog servers to the latest. Marking this thread as solved.
    https://wiki.fogproject.org/wiki/index.php?title=FOG_Client#FOG_Client_with_Sysprep


  • Moderator

    @zpoling Try setting the client to delayed start in services.



  • With early hostname enabled and the client told to join AD after imaging, the problem still occurred. Here’s the log from one of the computers that I imaged today that also had the issue. I’m not looking for answers anymore, I’m just going to keep working around it. However, if anyone would like to me to continue running tests or troublingshooting, I’d be more than happy to.

    Cheers, everyone.

     6/14/2016 11:36 AM Client-Info Client Version: 0.10.6
     6/14/2016 11:36 AM Client-Info Client OS:      Windows
     6/14/2016 11:36 AM Client-Info Server Version: 8060
     6/14/2016 11:36 AM Middleware::Response Success
     6/14/2016 11:36 AM HostnameChanger Checking Hostname
     6/14/2016 11:36 AM HostnameChanger Removing host from active directory
     6/14/2016 11:36 AM HostnameChanger The machine is not currently joined to a domain, code =  2692
     6/14/2016 11:36 AM HostnameChanger Renaming host to ABLELP-3
     6/14/2016 11:36 AM Power Creating shutdown request
     6/14/2016 11:36 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0
     6/14/2016 11:37 AM HostnameChanger Success, code =  0
     6/14/2016 11:37 AM Power Creating shutdown request
     6/14/2016 11:37 AM Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0
     6/14/2016 11:39 AM Client-Info Client Version: 0.10.6
     6/14/2016 11:39 AM Client-Info Client OS:      Windows
     6/14/2016 11:39 AM Client-Info Server Version: 8060
     6/14/2016 11:39 AM Middleware::Response Success
     6/14/2016 11:39 AM HostnameChanger Checking Hostname
     6/14/2016 11:39 AM HostnameChanger Removing host from active directory
     6/14/2016 11:39 AM HostnameChanger Success, code =  0
     6/14/2016 11:39 AM Power Creating shutdown request
     6/14/2016 11:39 AM Power Parameters: /r /c "Host left active directory, restart needed" /t 0
     6/14/2016 11:39 AM HostnameChanger Renaming host to ABLELP-3
     6/14/2016 11:39 AM Power Creating shutdown request
     6/14/2016 11:39 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0
     6/14/2016 11:39 AM HostnameChanger Success, code =  0
     6/14/2016 11:39 AM Power Creating shutdown request
     6/14/2016 11:39 AM Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0
     6/14/2016 11:41 AM Client-Info Client Version: 0.10.6
     6/14/2016 11:41 AM Client-Info Client OS:      Windows
     6/14/2016 11:41 AM Client-Info Server Version: 8060
     6/14/2016 11:41 AM Middleware::Response Success
     6/14/2016 11:41 AM HostnameChanger Checking Hostname
     6/14/2016 11:41 AM HostnameChanger Removing host from active directory
     6/14/2016 11:41 AM HostnameChanger Success, code =  0
     6/14/2016 11:41 AM Power Creating shutdown request
     6/14/2016 11:41 AM Power Parameters: /r /c "Host left active directory, restart needed" /t 0
     6/14/2016 11:41 AM HostnameChanger Renaming host to ABLELP-3
     6/14/2016 11:41 AM Power Creating shutdown request
     6/14/2016 11:41 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0
     6/14/2016 11:41 AM HostnameChanger Success, code =  0
     6/14/2016 11:41 AM Power Creating shutdown request
     6/14/2016 11:41 AM Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0
     6/14/2016 11:43 AM Client-Info Client Version: 0.10.6
     6/14/2016 11:43 AM Client-Info Client OS:      Windows
     6/14/2016 11:43 AM Client-Info Server Version: 8060
     6/14/2016 11:43 AM Middleware::Response Success
     6/14/2016 11:43 AM HostnameChanger Checking Hostname
     6/14/2016 11:43 AM HostnameChanger Removing host from active directory
     6/14/2016 11:43 AM HostnameChanger Success, code =  0
     6/14/2016 11:43 AM Power Creating shutdown request
     6/14/2016 11:43 AM Power Parameters: /r /c "Host left active directory, restart needed" /t 0
     6/14/2016 11:43 AM HostnameChanger Renaming host to ABLELP-3
     6/14/2016 11:43 AM Power Creating shutdown request
     6/14/2016 11:43 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0
     6/14/2016 11:43 AM HostnameChanger Unknown Return Code:  1115
    6/14/2016 11:45 AM Client-Info Client Version: 0.10.6
     6/14/2016 11:45 AM Client-Info Client OS:      Windows
     6/14/2016 11:45 AM Client-Info Server Version: 8060
     6/14/2016 11:45 AM Middleware::Response Success
     6/14/2016 11:45 AM HostnameChanger Checking Hostname
     6/14/2016 11:45 AM HostnameChanger Removing host from active directory
     6/14/2016 11:45 AM HostnameChanger The machine is not currently joined to a domain, code =  2692
     6/14/2016 11:45 AM HostnameChanger Renaming host to ABLELP-3
     6/14/2016 11:45 AM Power Creating shutdown command in 60 seconds
     6/14/2016 11:45 AM Bus {
      "self": true,
      "channel": "Power",
      "data": "{\r\n  \"action\": \"request\",\r\n  \"period\": 60,\r\n  \"options\": 2,\r\n  \"command\": \"/r /c \\\"FOG needs to rename your computer\\\" /t 0\",\r\n  \"message\": \"This computer needs to perform maintenance.\"\r\n}"
    }
     6/14/2016 11:45 AM Bus Emmiting message on channel: Power
    ------------------------------------------------------------------------------
    
     6/14/2016 11:45 AM Service Power operation being requested, checking back in 30 seconds
     6/14/2016 11:45 AM Service Power operation being requested, checking back in 30 seconds
     6/14/2016 11:46 AM Power Creating shutdown request
     6/14/2016 11:46 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0
     6/14/2016 11:46 AM Service Power operation being requested, checking back in 30 seconds
     6/14/2016 11:46 AM Bus {
      "self": true,
      "channel": "Power",
      "data": "{\r\n  \"action\": \"shuttingdown\"\r\n}"
    }
     6/14/2016 11:46 AM Bus Emmiting message on channel: Power
     6/14/2016 11:47 AM Main Overriding exception handling
     6/14/2016 11:47 AM Main Bootstrapping Zazzles
     6/14/2016 11:47 AM Controller Initialize
     6/14/2016 11:47 AM Entry Creating obj
     6/14/2016 11:47 AM Controller Start
    
     6/14/2016 11:47 AM Service Starting service
     6/14/2016 11:48 AM Bus Became bus server
     6/14/2016 11:48 AM Bus {
      "self": true,
      "channel": "Status",
      "data": "{\r\n  \"action\": \"load\"\r\n}"
    }
     6/14/2016 11:48 AM Bus Emmiting message on channel: Status
     6/14/2016 11:48 AM Client-Info Client Version: 0.10.6
     6/14/2016 11:48 AM Client-Info Client OS:      Windows
     6/14/2016 11:48 AM Client-Info Server Version: 8060
     6/14/2016 11:48 AM Middleware::Response Success
     6/14/2016 11:48 AM HostnameChanger Checking Hostname
     6/14/2016 11:48 AM HostnameChanger Hostname is correct
     6/14/2016 11:48 AM HostnameChanger Success, code =  0
     6/14/2016 11:48 AM Power Creating shutdown request
     6/14/2016 11:48 AM Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0
    

  • Moderator

    @zpoling I’m just going to throw this out there in case you can’t get positive results from using the FOG Client to set the machine name and connect the target to AD.

    I do this today with the unattend.xml script and a FOG post install script that during imaging updates the unattend.xml file with the require values. So as a fall back option, this way does work and work well. So just keep that in mind if you don’t get satisfaction using the FOG Client.



  • @Tom-Elliott

    I checked through our unattended file and made sure the computer name string is not there. I unchecked the early hostname changer earlier in the thread for trouble shooting, but the issue was still happening. I’ve since updated the server, so I’ll set it back and retry some imaging with the computers told to join the domain. What I’ve been doing is just making sure to disable domain joining after tasks until the computer is at the first logon screen. At that point, setupcomplete.cmd has started the fog service and the hostname is always correct, so once told to join the domain it happens without the original issue being present. I’ll ignore what I’ve been doing and see where the early hostname changer gets me.

    I know you’re a highly trained professional and don’t need to hear about the unforeseen consequences, Mr. Freeman, but I do have a question about it. I have made sure to disable the fog service before sysprepping, and our setupcomplete.cmd turns it back on after the unattended setup has already completed. Is this all that you were referencing?

    Again, thanks for the help, everyone. What what you’ve all told me, it seems to just be a freak issue. If it continues after a few trunk updates, I’ll come back and detail any related issues or findings.


  • Moderator

    @Tom-Elliott said in Computers Join Domain before Hostname Changes:

    I’m going to guess, all this troubleshooting and the client is actually ACTIVE in the SYSPREP state causing unforeseen consequences?

    IMO, it has to be.


  • Senior Developer

    Are your images sysprepped? If they are sysprepped, are they setup to define a random computer name?

    The only thing I can think is the “active computer name” is not matching the “set computer name”.

    Is HOSTNAME_EARLY enabled under FOG Configuration Page->FOG Settings -> (I forget the sub menu item)?

    If you disable HOSTNAME_EARLY does the hostname rename and join AD appropriately?

    I ask these questions because there have been some work to the init’s in an attempt to correct similar type bugs where the hostname would say it was correct, but to the admin’s the hostname was not correct. The join domain would work, but would use the “incorrect” name (if I do indeed recall correctly – maybe it was the other way around, joining AD would be correct, but hostname would still be displayed incorrectly). I ask about sysprep because in the case they are, if the <ComputerName>*</ComputerName> is set, there’s not much the hostname_early feature can do as the computer name is randomly generated. Where this get’s tricky is the OS hasn’t loaded quite yet and the AD Join element might work perfectly but setup the “incorrect hostname” leaving FOG to appear as if it IS joining the domain before the hostname change has taken place, but really the FOG Client had checked the hostname before the “randomly generated” name was recreated. The hostname check sees it is correct, then continues on (at which point SYSPREP has renamed the host) and it tries to join the Domain, but it’s joining using the incorrect hostname.

    This is just a guess, a wild stab in the dark. This further adds credence to the last paragraph of the FOG Client wiki: https://wiki.fogproject.org/wiki/index.php?title=FOG_Client#FOG_Client_with_Sysprep

    I’m going to guess, all this troubleshooting and the client is actually ACTIVE in the SYSPREP state causing unforeseen consequences?


  • Moderator

    @zpoling This issue just makes no sense to me. Why only you? Why only your site? At work, we have 6 independent stand-alone fog servers at 6 sites, and are in the process of building a large 14 node system with a central server for all the other sites and everything is fine. Also, everything is fine for everyone else here on the forums. I imagine we’d be swamped with threads related to this issue if it was a genuine bug of some kind.

    So the question remains is… why you?

    The questions I’ve been asking have kinda been about that question. 3rd party apps, what’s different, etc.

    Maybe pick your own brain for a bit and figure out what it is that you guys do differently?
    What does DNS? Do you have DNS issues? What is doing DHCP? What settings in fog are unique to you?



  • @Wayne-Workman

    Grace timeout is set to 60, check in timeout is 600.

    As far as third party apps, we have Office 2016, Java, and Silverlight. The install is just standard Windows 10 Enterprise.


  • Moderator

    @zpoling what is the fog client Grace time out and check in timeout set to on your system?


  • Moderator

    @Wayne-Workman While I can’t comment of the fog client, typically after you do a name change (via powershell or vbscript) you must reboot to update all of the services. Just changing the registry isn’t sufficient. Once that was done then you could connect it to AD.

    Now that I think about it, you may be able to get away with updating the registry, restarting the workstation service then connecting the workstation (but I haven’t tried that).


  • Moderator

    @Joe-Schmitt said in Fog Client - Snapins run after computer rename/domain join:

    @networkguy Here is the order in which the modules are run every time:

    • ClientUpdater
    • TaskReboot
    • HostnameChanger
    • SnapinClient
    • PrinterManager
    • GreenFOG
    • UserTracker

    Here he lists the order of operations. Host name changer also does the domain joining, but as you see in the logs, the name change happens first.

    Something is causing the client to think the host name isn’t correct after having set it already once.

    What other third party applications do you have installed?


  • Moderator

    @zpoling so at this point, after those tests, we can safely say the actions of the fog client are causing the issue.

    However I still don’t understand why… there’s a thread around here where joe lists the order in which the client does things. I’ll try to find it.



  • @Quazz After updating Fog, should I reboot the server?



  • After updating Fog, the issue is still occurring.


  • Moderator

    Just be aware that the update process is a little aggressive on the development trunk (or sometimes just called trunk). Once 1.3.0 is finally released then the need to update every so often will stop (until they are ready to release fog 2.0, which I would expect to have a pretty long trunk release too).


  • Moderator

    @zpoling I probably update it 3 times a day or more, but then again I’m in the testers group for a reason.



  • @Quazz Ah. I was taught on the principle of “if it’s working, don’t fix it.” So even if it’s a small issue such as this, updating is the goto option? Fog’s updating as I type. I’ll try that from now on. I’ll report back if the issue keeps happening.

    Thanks for all of your help, everyone!


Log in to reply
 

386
Online

38973
Users

10712
Topics

101674
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.