FOG HostnameChanger and Sysprep
-
Ahhhh it takes %MACHINENAME% but not %COMPUTERNAME%? Bah.
Thanks for the link! It definitely helps, and I appreciate it.
-
Ah. This actually still isn’t working for me. Using this in the specialize pass (in the same place):
<ComputerName>%MACHINENAME%</ComputerName>
Do you know where the %MACHINENAME% variable is pulling its information from? I was under the impression it grabs the hostname currently in place, but I may have misunderstood.
-
Its in the registry
[url]http://www.windowstipspage.com/computername-registry-key/[/url]
my understanding is you also need to be using the the join secure in example 2
-
Ahhh that could be the problem I’m having. Idk if I’ll be able to get it working for my workplace (we have a bit of an odd situation with joining domains, where doing it through the unattend isn’t really an option – don’t ask, it’s complicated, haha). Maybe I’ll just add in some vbscript to query for that registry key and edit the unattend in the middle of the process to the current computer name.
Thanks for the link though! I always like to see where variables are coming from.
-
i actually have a solution for this, i’ve written code so that once fog has deployed the image to the machine it will change sysprep.inf for xp and unattend.xml to the hostname in the fog database and will add ad information from fog if set to join AD so when sysprep runs it already matches what has been set in FOG, this would solve all this but i don’t think the developers will go for it as it renders hostname change early un-needed and these features in FOGClient are no longer needed. if you want info on how to do this pm me as it’d be a lengthy tutorial/set of instructions to write. if a few people find it easy to implement then i’ll post an how to when i have the time to sit down and write one up…
-
Thanks for the info
my suggestion join secure did not work as it only works with WDS and Microsoft Deployment Tools. Its a shame with sysprep not being able to bypass comutername easily
I hope you work gets put in to a future release oF FOG as the Change Hostname Early feature does not work as intended
-
[quote=“Lee Rowlett, post: 7960, member: 28”]i actually have a solution for this, i’ve written code so that once fog has deployed the image to the machine it will change sysprep.inf for xp and unattend.xml to the hostname in the fog database and will add ad information from fog if set to join AD so when sysprep runs it already matches what has been set in FOG, this would solve all this but i don’t think the developers will go for it as it renders hostname change early un-needed and these features in FOGClient are no longer needed. if you want info on how to do this pm me as it’d be a lengthy tutorial/set of instructions to write. if a few people find it easy to implement then i’ll post an how to when i have the time to sit down and write one up…[/quote]
Haha, I would like to see that, actually. Although - if you’d like to keep it short and simple, could you tell me exactly where (and as a result, when) the code is being executed to open and alter unattend.xml? Are you running a MySQL query from the computer being imaged to grab the computer name? I could probably figure it out from there.
I actually had a system in place which would actually open up and edit the unattend file mid sysprep, by adding this registry key right before restarting, but after sysprepping -
“reg add HKLM\System\Setup /v CmdLine /t REG_SZ /d “cmd /c cscript //nologo C:\windows\system32\sysprep\editunattend.vbs” /f”Editunattend.vbs would essentially open up c:\Windows\Panther\unattend.xml, expand the environment variable for %COMPUTERNAME% that was in place, look for a string called “REPLACEME” in the unnattend file, and swap the strings and resave the file. Then it would kick off %WINDIR%\System32\oobe\windeploy.exe and sysprep would continue like normal.
Never got it to work though – it would work when there was a msgbox asking for the computer name as an input, so I’m thinking the %COMPUTERNAME% variable is either blank or unavailable when it tries running. Which is a shame.
-
See this post. Instructions are in there too now: [url]http://fogproject.org/forum/threads/hostname-change-joining-domain-before-sysprep-runs-xp-win7.3332/#post-7964[/url]
It changes it straight after fog has imaged the machine before the machine reboots into the os
Let me know how you get on
-
What are the benefits of this besides removing the 2 reboots to rename and join a computer to the domain. I’m pretty sure in FOG 0.33, the snap-in deployment will be quicker before the check-in time has been reduced to 30 seconds.
-
Just another alternative I guess…
-
Honestly, the reason I’m interested in it is - just because. Haha. The extra reboot certainly isn’t the end of the world. I would technically save a bit of time, but it’s more an excuse for me to learn more about how FOG works, and how PHP works, so I’m just playing with it when I have extra time (which isn’t very often). I don’t actually use snapins to deploy software - I have a lot of VBS that pulls info from active directory and deploys software from a networked drive based on that information.
Lee, I actually have been working on your post – I don’t have it in production yet, but I still have to fiddle around with buildroot. Although, I’m not sure I’ll need to - I think sed is actually included in whatever build of init.gz I have.