Here is a simple script to get the FQDN (fully qualified domain name, ie somehost.somedomain.com) of a Windows system via WMI.
Note that it is possible for different NICs to have different DNS suffixes attached, so we loop through them all. To remove the display of NICs with no DNS name, just comment out the ELSE clause.
strComputer = "."
Set oWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNICInfo = oWMI.ExecQuery("Select * from Win32_NetworkAdapterConfiguration")
For Each oNICProp in colNICInfo
If Not oNICProp.DNSHostName = "" Then
wscript.StdOut.Write oNICProp.Caption
wscript.StdOut.WriteLine " --> " & oNICProp.DNSHostName & "." & oNICProp.DNSDomain
Else
wscript.StdOut.Write oNICProp.Caption
wscript.StdOut.WriteLine " --> adapter not configured"
End If
Next