• I don’t know if this is a bug or a request. However, we use hostnamechanger alot and I have noticed that it just disables the account in active directory. Is there a reason for this? Can it be changed to delete? We tried to decompile and recompile the dll file and could not get the desired result. Help 😄

  • Senior Developer

    Over the next few months I’m going to try getting my C# hat sharpened and fitted so hopefully I can help more with this.

  • Moderator

    It probably can and has been done by software. I’m just stating that the default behavior from AD when you take a computer from a domain to a workgroup is to disable the account and not delete it. Depending on how FOG renames a computer will depend on if an orphaned account is left in AD with the old name.

  • Is this not done with a switch in the hostname changer? I have seen people writing scripts to delete instead of disable in several different program languages.

  • Moderator

    I believe this is a feature of AD, and not fog. Taking a machine from the domain to a workgroup causes AD to disable the account. Renaming a computer on the host either via FOG or manually doing it, can lead to mixed results. Sometimes it works and you get a renamed account in AD, sometimes it disables the old name account and makes a new one, and sometimes it doesn’t do much of anything but disconnect the computer from AD and cause trust issues.

  • I can say that within the source of HostNameChanger changing MOD_HostNameChanger.cs file, there are two values that seem wrong. There are two records: One under the UnJoinOptions that say NETSETUP_ACCOUNT_DELETE = 0x00000004, and the other when it is Attempting to unregister from domain… that is UnJoinOptions.NETSETUP_ACCOUNT_DELETE. I was curious if this is actually supposed to be NET_ACCT_DELETE and not NET_ACCOUNT_DELETE. Everything I Google with NET_ACCOUNT_DELETE comes up with zero results, but NET_ACCT_DELETE has numerous. I didn’t know if there value of 0x00000004 had something to do with the disabling and not deleting. Just trying to give some info to try and help you.

    Those are lines are 28 and line 481 just fyi within MOD_HostNameChanger.cs