The adsiedit.msc and adsiedit.dll from a Windows Server 2008 R2 domain controller were copied to %systemroot%\system32 on a new host (with new hostname). The latter is Windows Server 2008 R2 member server. Changing to %systemroot%\system32 and execute "regsvr32 adsiedit.dll" with elevated privilege triggered this error:
[Window Title]
RegSvr32
[Content]
The module "adsiedit.dll" failed to load.
Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.
A dynamic link library (DLL) initialization routine failed.
[OK]
Even specifying regsvr32 c:\windows\system32\adsiedit.dll resulted in the same error. The only way to get ADSIEDIT to work is to install the tool via RSAT / AD LDS Snap-Ins.
Comment from Kurt Hudson, MSFT
First, if you have issues like this, you should post them to the Directory Services Forum http://social.technet.microsoft.com/Forums/en/winserverDS/threads
Second, you should NOT be copying the dll and msc files from one Windows Server 2008 R2 or 2008 server at all. All Windows Server 2008 and Windows Server 2008 R2 servers have these files available as part of the Role Administration tools. If it is not a domain controller, then go into Server Manager and install. There is a link in the article above that takes to you the article which explains exactly how to do that. If you have issues following that article (
http://technet.microsoft.com/en-us/library/cc730825.aspx), please, let us know. I wrote the article and one of my colleagues later updated it for Windows Server 2008 R2. We actually test this stuff when we write it, but if you are seeing something different, then we would like to know about it. However, that article is the place to post your comments and give feedback. Again, if you need quicker help, then the Directory Services forum is the place to go.