I know that this gives you the fqdn of the system
Code:
On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
strComputer = "."
Set dict = CreateObject("Scripting.Dictionary")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
If Len(objItem.DNSDomain) > 0 And Len(objItem.DNSHostName) > 0 Then
dict.Add (objItem.DNSHostName & "." & objItem.DNSDomain), dict.Count
End If
Next
fqdnArray = dict.Keys
For Each fqdn In fqdnArray
WScript.Echo fqdn
Next
I can't really see a case when a system would have more than 1 FQDN
This little bit of code gives Domain, system name and user
Code:
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Domain = " & WshNetwork.UserDomain
WScript.Echo "Computer Name = " & WshNetwork.ComputerName
WScript.Echo "User Name = " & WshNetwork.UserName
A useful VBScript forum would be fantastic, we could put bits of code in and other people could then use it as a reference.