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

Update Registry when FOG client changes Host.

Scheduled Pinned Locked Moved
Feature Request
2
5
2.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.
  • J
    Jaymes Driver Developer
    last edited by Jun 4, 2013, 11:13 AM

    I’m interested in working on the FOG client a bit. We use Novell in our network and we have to update the registry to reflect the host name of the machine in order for our auto login scripts to work.

    I’d like to know how to add a simple registry command to the FOG client so when it updates the host name it updates the registry with the same host data. Ideas are welcome!!!

    Thanks for your help!

    WARNING TO USERS: My comments are written completely devoid of emotion, do not mistake my concise to the point manner as a personal insult or attack.

    1 Reply Last reply Reply Quote 0
    • X
      x23piracy
      last edited by Jun 5, 2013, 6:32 PM

      Hi,

      another suggestion: why not writing a simple script for each machine (deployed by whatever)
      that checks the actual real hostname against that one in the registry?

      If you need that in place of a shutdown because the registry change is only confirmed by a restart
      then look around howto execute something before a shutdown.

      Greetz X23

      ║▌║█║▌│║▌║▌█

      1 Reply Last reply Reply Quote 0
      • J
        Jaymes Driver Developer
        last edited by Jun 5, 2013, 6:33 PM

        Thanks for the idea x23 I’ll give this a shot, I’ll see what I can’t come up with.

        WARNING TO USERS: My comments are written completely devoid of emotion, do not mistake my concise to the point manner as a personal insult or attack.

        1 Reply Last reply Reply Quote 0
        • X
          x23piracy
          last edited by Jun 5, 2013, 6:37 PM

          Hi,

          in case of windows:

          actual computername:
          [CODE]HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName[/CODE]
          env variable:
          [CODE]hostname[/CODE]
          or
          [CODE]%COMPUTERNAME%[/CODE]

          doing with the registry…
          [QUOTE]REG QUERY /?
          REG ADD /?
          REG DELETE /?
          REG COPY /?
          REG SAVE /?
          REG RESTORE /
          REG LOAD /?
          REG UNLOAD /?
          REG COMPARE /
          REG EXPORT /?
          REG IMPORT /?[/QUOTE]

          [CODE]@echo off
          set newhname=%COMPUTERNAME%
          FOR /F “tokens=3 skip=2” %%i IN (‘REG QUERY “HKLM\System\CurrentControlSet\Control\ComputerName\Computername” /v ComputerName’) DO SET oldhname=%%i
          if %newhname% EQU %oldhname% goto donothing
          REG ADD HKLM\System\CurrentControlSet\Control\ComputerName /v ComputerName /t REG_SZ /d %newhname%
          :donothing[/CODE]

          Greetz X23

          ║▌║█║▌│║▌║▌█

          1 Reply Last reply Reply Quote 0
          • J
            Jaymes Driver Developer
            last edited by Jun 6, 2013, 4:51 PM

            okay, so I found the section in MOD_HostNameChanger.cs in the folder /usr/src/fog_0.32/FOG Service/src/FOG_HostNameChanger

            I have added these two lines

            regKey = Registry.LocalMachine.OpenSubKey(@“SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon”, true);
            regKey.SetValue(“AltDefaultDomainName”, newname);
            regKey = Registry.LocalMachine.OpenSubKey(@“SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon”, true);
            regKey.SetValue(“DefaultDomainName”, newname);

            to the class
            [code]
            private void doDefaultMode( string newname)
            {
            RegistryKey regKey = null;
            log(MOD_NAME, “Using default fog method.”);
            regKey = Registry.LocalMachine.OpenSubKey(@“SYSTEM\CurrentControlSet\Services\Tcpip\Parameters”, true);
            regKey.SetValue(“NV Hostname”, newname);
            regKey = Registry.LocalMachine.OpenSubKey(@“SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName”, true);
            regKey.SetValue(“ComputerName”, newname);
            regKey = Registry.LocalMachine.OpenSubKey(@“SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName”, true);
            regKey.SetValue(“ComputerName”, newname);
            regKey = Registry.LocalMachine.OpenSubKey(@“SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon”, true);
            [/code]

            being the registry values I am wanting to change are in [B]HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultDomainName[/B] and [B]HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AltDefaultDomainName[/B]
            and I want to populate it with the same information being supplied in the rest of the registry keys.

            Do I need to compile this and push it, or is saving the configurations going to be good enough?

            I already built my image, do I need to update the fog client on my images and push it out again?

            Sorry not done anything like this before don’t want to break anything and I want it to work 😄

            WARNING TO USERS: My comments are written completely devoid of emotion, do not mistake my concise to the point manner as a personal insult or attack.

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

            163

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project