
GetDomainName – Retrieving the domain name
‘ Returns the domain name’ Requires a reference to System.Management and the respective ImportsFunction GetDomainName() As String Dim mos As New ManagementObjectSearcher _ (“SELECT * FROM Win32_ComputerSystem”) Dim mo As ManagementObject For Each mo In mos.Get() Return mo(“Domain”) NextEnd Function