(imported topic written by Steve91)
Hi Chaps,
I’m trying to retrieve the fqdn for some servers and at the moment I’ve only come up with the following relevance:
if value “ProductType” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions” of registry != “WinNT” then (value “Hostname” of key “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters” of registry as string & “.” as string & value “Domain” of key “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters” of registry as string) else “Workstation”
It’s a bit messy but it does the job in most cases, the only problem is that some servers don’t have a value for “Domain” in the registry so I’m only able to return their hostname.
Is there a cleaner way to retrieve the fqdn?
Cheers
Steve