Computers Join Domain before Hostname Changes
-
@Wayne-Workman The fog service is disabled on startup until the setupcomplete.cmd is called for. That was actually my thread where you created the Wiki post about it
I just checked through our unattend file and I cannot find <ComputerName>*</ComputerName>.
-
As far as I know <ComputerName> doesn’t work in unattend on Windows 10 anwyay.
-
@zpoling something has to be causing the naming issue. Is it possible that two hosts in host management exist for the computers? Like one for wifi mac and one for Lan mac? If you search fog for some of those names showing in AD, what are the results?
-
@Wayne-Workman Non of them appear in Fog with the default name or MAC, and they never have. We have a small scale setup with Fog, so it’s easy to keep track of that sort of thing.
-
@zpoling can you image one of the problem computers and after all reboots and joining is done, get the log for us from the computer?
-
Here’s all the hostname data from the log.
6/8/2016 10:36 AM Client-Info Client Version: 0.10.6 6/8/2016 10:36 AM Client-Info Client OS: Windows 6/8/2016 10:36 AM Client-Info Server Version: 7541 6/8/2016 10:36 AM Middleware::Response Success 6/8/2016 10:36 AM HostnameChanger Checking Hostname 6/8/2016 10:36 AM HostnameChanger Removing host from active directory 6/8/2016 10:36 AM HostnameChanger The machine is not currently joined to a domain, code = 2692 6/8/2016 10:36 AM HostnameChanger Renaming host to DIESEL-1 6/8/2016 10:36 AM Power Creating shutdown request 6/8/2016 10:36 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0 6/8/2016 10:36 AM HostnameChanger Success, code = 0 6/8/2016 10:36 AM Power Creating shutdown request 6/8/2016 10:36 AM Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0 6/8/2016 10:39 AM Client-Info Client Version: 0.10.6 6/8/2016 10:39 AM Client-Info Client OS: Windows 6/8/2016 10:39 AM Client-Info Server Version: 7541 6/8/2016 10:39 AM Middleware::Response Success 6/8/2016 10:39 AM HostnameChanger Checking Hostname 6/8/2016 10:39 AM HostnameChanger Removing host from active directory 6/8/2016 10:39 AM HostnameChanger Success, code = 0 6/8/2016 10:39 AM Power Creating shutdown request 6/8/2016 10:39 AM Power Parameters: /r /c "Host left active directory, restart needed" /t 0 6/8/2016 10:39 AM HostnameChanger Renaming host to DIESEL-1 6/8/2016 10:39 AM Power Creating shutdown request 6/8/2016 10:39 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0 6/8/2016 10:39 AM HostnameChanger Success, code = 0 6/8/2016 10:39 AM Power Creating shutdown request 6/8/2016 10:39 AM Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0 6/8/2016 10:41 AM Client-Info Client Version: 0.10.6 6/8/2016 10:41 AM Client-Info Client OS: Windows 6/8/2016 10:41 AM Client-Info Server Version: 7541 6/8/2016 10:41 AM Middleware::Response Success 6/8/2016 10:41 AM HostnameChanger Checking Hostname 6/8/2016 10:41 AM HostnameChanger Removing host from active directory 6/8/2016 10:41 AM HostnameChanger Success, code = 0 6/8/2016 10:41 AM Power Creating shutdown request 6/8/2016 10:41 AM Power Parameters: /r /c "Host left active directory, restart needed" /t 0 6/8/2016 10:41 AM HostnameChanger Renaming host to DIESEL-1 6/8/2016 10:41 AM Power Creating shutdown request 6/8/2016 10:41 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0 6/8/2016 10:41 AM HostnameChanger Success, code = 0 6/8/2016 10:41 AM Power Creating shutdown request 6/8/2016 10:41 AM Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0 6/8/2016 10:44 AM Client-Info Client Version: 0.10.6 6/8/2016 10:44 AM Client-Info Client OS: Windows 6/8/2016 10:44 AM Client-Info Server Version: 7541 6/8/2016 10:44 AM Middleware::Response Success 6/8/2016 10:44 AM HostnameChanger Checking Hostname 6/8/2016 10:44 AM HostnameChanger Removing host from active directory 6/8/2016 10:44 AM HostnameChanger Success, code = 0 6/8/2016 10:44 AM Power Creating shutdown request 6/8/2016 10:44 AM Power Parameters: /r /c "Host left active directory, restart needed" /t 0 6/8/2016 10:44 AM HostnameChanger Renaming host to DIESEL-1 6/8/2016 10:44 AM Power Creating shutdown request 6/8/2016 10:44 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0 6/8/2016 10:44 AM HostnameChanger Unknown Return Code: 1364 6/8/2016 10:46 AM Client-Info Client Version: 0.10.6 6/8/2016 10:46 AM Client-Info Client OS: Windows 6/8/2016 10:46 AM Client-Info Server Version: 7541 6/8/2016 10:46 AM Middleware::Response Success 6/8/2016 10:46 AM HostnameChanger Checking Hostname 6/8/2016 10:46 AM HostnameChanger Hostname is correct 6/8/2016 10:47 AM HostnameChanger Success, code = 0 6/8/2016 10:47 AM Power Creating shutdown request 6/8/2016 10:47 AM Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0 6/8/2016 10:49 AM Client-Info Client Version: 0.10.6 6/8/2016 10:49 AM Client-Info Client OS: Windows 6/8/2016 10:49 AM Client-Info Server Version: 7541 6/8/2016 10:49 AM Middleware::Response Success 6/8/2016 10:49 AM HostnameChanger Checking Hostname 6/8/2016 10:49 AM HostnameChanger Hostname is correct 6/8/2016 10:49 AM HostnameChanger Host is already joined to target domain
-
@zpoling is it possible that you have group policy pushing out an older client? On this computer you just imaged, check if there is just one fog client installed, and if there is just one fog service in services.
-
@Wayne-Workman We never push out the client. There is only one installed, as well as only one service running.
-
@zpoling we need @joe-schmitt to look at it and comment. Without hands on the problem, I am unsure where to go from here.
What is unique about the problem hosts? What is different?
-
@Quazz said in Computers Join Domain before Hostname Changes:
As far as I know <ComputerName> doesn’t work in unattend on Windows 10 anwyay.
It works the same in win10 as in Win7. In my setup I don’t have the FOG client connect the computer to the domain or set the system name. I do that with a postinstall script because I need to control where the device connects in AD depending on the target location and image being deployed. Because of the dynamic nature of this OU placement it was just easier to calculate the values, update the unattend.xml file and let Windows OOBE setup do the rest.
-
@Wayne-Workman The problem has been happening to all machines indiscriminately. Each image is made on that respective model of computer, so the only thing different would be drivers installed on each image. We use the same unattend file for each image.
-
@zpoling can you disable domain joining on a computer and image it? And then observe it’s renaming? Provide the log for that too? This is to eliminate variables and try to isolate what’s happening.
-
For clarity, will you confirm that you DO NOT have the following section in your unattend.xml file? The reason why I ask is that I could see a potential for a race condition between the unattend.xml connecting the device to the domain and then the fog client doing its bit since the fog client does have a check in interval that also impacts timing of when things happen.
<component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
@Wayne-Workman The error stated in the OP doesn’t occur if I tell the machine to join the domain after the fog service is done with post-image tasks.
6/8/2016 11:57 AM Client-Info Client Version: 0.10.6 6/8/2016 11:57 AM Client-Info Client OS: Windows 6/8/2016 11:57 AM Client-Info Server Version: 7541 6/8/2016 11:57 AM Middleware::Response Success 6/8/2016 11:57 AM HostnameChanger Checking Hostname 6/8/2016 11:57 AM HostnameChanger Removing host from active directory 6/8/2016 11:57 AM HostnameChanger ERROR: Required ADDom information is missing 6/8/2016 11:57 AM HostnameChanger Renaming host to DIESEL-1 6/8/2016 11:57 AM Power Creating shutdown request 6/8/2016 11:57 AM Power Parameters: /r /c "FOG needs to rename your computer" /t 0 6/8/2016 12:00 PM Client-Info Client Version: 0.10.6 6/8/2016 12:00 PM Client-Info Client OS: Windows 6/8/2016 12:00 PM Client-Info Server Version: 7541 6/8/2016 12:00 PM Middleware::Response Success 6/8/2016 12:00 PM HostnameChanger Checking Hostname 6/8/2016 12:00 PM HostnameChanger Hostname is correct ***Hostname Logs show same as above 6 lines until told to join domain*** 6/8/2016 12:09 PM Client-Info Client Version: 0.10.6 6/8/2016 12:09 PM Client-Info Client OS: Windows 6/8/2016 12:09 PM Client-Info Server Version: 7541 6/8/2016 12:09 PM Middleware::Response Success 6/8/2016 12:09 PM HostnameChanger Checking Hostname 6/8/2016 12:09 PM HostnameChanger Hostname is correct 6/8/2016 12:09 PM HostnameChanger Success, code = 0 6/8/2016 12:09 PM Power Creating shutdown command in 60 seconds 6/8/2016 12:09 PM Bus { "self": true, "channel": "Power", "data": "{\r\n \"action\": \"request\",\r\n \"period\": 60,\r\n \"options\": 2,\r\n \"command\": \"/r /c \\\"Host joined to Active Directory, restart required\\\" /t 0\",\r\n \"message\": \"This computer needs to perform maintenance.\"\r\n}" } 6/8/2016 12:09 PM Bus Emmiting message on channel: Power 6/8/2016 12:09 PM Service Power operation being requested, checking back in 30 seconds 6/8/2016 12:11 PM Main Overriding exception handling 6/8/2016 12:11 PM Main Bootstrapping Zazzles 6/8/2016 12:11 PM Controller Initialize 6/8/2016 12:11 PM Entry Creating obj 6/8/2016 12:11 PM Controller Start 6/8/2016 12:11 PM Service Starting service 6/8/2016 12:11 PM Bus Became bus server 6/8/2016 12:11 PM Bus { "self": true, "channel": "Status", "data": "{\r\n \"action\": \"load\"\r\n}" } 6/8/2016 12:11 PM Bus Emmiting message on channel: Status 6/8/2016 12:11 PM Client-Info Client Version: 0.10.6 6/8/2016 12:11 PM Client-Info Client OS: Windows 6/8/2016 12:11 PM Client-Info Server Version: 7541 6/8/2016 12:11 PM Middleware::Response Success 6/8/2016 12:11 PM HostnameChanger Checking Hostname 6/8/2016 12:11 PM HostnameChanger Hostname is correct 6/8/2016 12:11 PM HostnameChanger Host is already joined to target domain
-
@george1421 That string is not in our unattend file.
-
@zpoling ok as a final test (just to say absolutely the fog client is suspect here).
Can you either disable the fog service when you deploy to this computer so that it never runs on the target even for 1 second? In my case when I install the fog client on the reference image I stop and disable the service immediately, then proceed with the MDT install of the other applications.
Then when the target system completes the installation process just before the login screen comes up I run the commands in the setupcompleted.cmd to set the service to auto start and then start the service. At that time then the fog client does what ever it has to do. If you enable the fog client the same way, then just disable the code that changes the fog client startup from disabled to auto. This way the fog client never runs.
So then the things to check for becomes this:
- The client should never ever connect to AD
- The name of the machine will be what ever windows selects as the default computer name. And this will not change.
Make sure these settings are consistent for 30 minutes. Then set the fog service to auto start and then start the service. Observe and report what happens. Understand I’m not doubting that this is happening, I’m trying to isolate the fog service running from the OOBE setup doing something unexpected.
-
@george1421 That’s how I have our fog service set up as well; Setupcomplete.cmd sets it back to auto. I’m assuming you want me to disable the early hostname changer too since you said the name of the machine should be the Windows default.
To note before I start this; if the client isn’t told to join the domain, it wont, even if the fog service is running.
I’ll get back to you with the results!
-
@zpoling I would leave early host name change turned on, and disable the code that re-enables the fog service just as George described. This test is to determine what’s going on with the hostname.
-
@Wayne-Workman I would suggest to turn off everything that could change the machine. We need to establish a normal baseline. I know it is a bit of a pain to go this route. But the first step is to turn everything off, then one thing on at a time. The next step after getting a baseline is to turn on the early name changer and see what that does.
I have to revert to the old adage of: You have to find out where the problem isn’t to be able to find out where it really is.
-
I’m starting the image process as I am typing this.
The fog service has been disabled in this image and the setupcomplete.cmd has been removed, so the service should not start again. The early hostname changer has been disabled as well.
Imaging is complete. The unattended setup is occurring now.
Just logged on for the first time. It has a default hostname and the fog service is not running.
After 30 minutes, nothing has changed. Nothing has called for the computer to restart.
After a manual restart, the same has been observed. The hostname is still default and the service is not running. I am going to start the service and see what happens. It should try to change the hostname and join the domain, as both settings are there. I will check the default computers OU and see what appears after the first reboot.
After the manual reboot, the computer made it to the log on screen but soon rebooted. The default computer name never showed up into the default OU, but the specified name on fog did. This means that the original issue did not occur.
6/9/2016 12:43 PM Client-Info Client Version: 0.10.6 6/9/2016 12:43 PM Client-Info Client OS: Windows 6/9/2016 12:43 PM Client-Info Server Version: 7541 6/9/2016 12:43 PM Middleware::Response Success 6/9/2016 12:43 PM HostnameChanger Users still logged in and enforce is disabled, delaying any further actions 6/9/2016 12:45 PM Client-Info Client Version: 0.10.6 6/9/2016 12:45 PM Client-Info Client OS: Windows 6/9/2016 12:45 PM Client-Info Server Version: 7541 6/9/2016 12:45 PM Middleware::Response Success 6/9/2016 12:45 PM HostnameChanger Users still logged in and enforce is disabled, delaying any further actions 6/9/2016 12:48 PM Client-Info Client Version: 0.10.6 6/9/2016 12:48 PM Client-Info Client OS: Windows 6/9/2016 12:48 PM Client-Info Server Version: 7541 6/9/2016 12:48 PM Middleware::Response Success 6/9/2016 12:48 PM HostnameChanger Checking Hostname 6/9/2016 12:48 PM HostnameChanger Removing host from active directory 6/9/2016 12:48 PM HostnameChanger The machine is not currently joined to a domain, code = 2692 6/9/2016 12:48 PM HostnameChanger Renaming host to TESTLP 6/9/2016 12:48 PM Power Creating shutdown request 6/9/2016 12:48 PM Power Parameters: /r /c "FOG needs to rename your computer" /t 0 6/9/2016 12:48 PM HostnameChanger Unknown Return Code: 1364 6/9/2016 12:49 PM Client-Info Client Version: 0.10.6 6/9/2016 12:49 PM Client-Info Client OS: Windows 6/9/2016 12:49 PM Client-Info Server Version: 7541 6/9/2016 12:49 PM Middleware::Response Success 6/9/2016 12:49 PM HostnameChanger Checking Hostname 6/9/2016 12:49 PM HostnameChanger Hostname is correct 6/9/2016 12:49 PM HostnameChanger Success, code = 0 6/9/2016 12:49 PM Power Creating shutdown request 6/9/2016 12:49 PM Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0
Does this look normal? If any of you would like me to test another factor, just let me know what to do and I’ll get it done.
On another note, I imaged 20 computers this morning while I was watching this test machine was working. I told them not to join the domain until after they were all correctly named and they all joined the domain correctly. The issue only happens when the machine has not been renamed already.