Dim strComputer As String = "." Dim objWMIService As Object = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") Dim colSettings As Object = objWMIService.ExecQuery("Select * from Win32_ComputerSystem") Dim objComputer As Object For Each objComputer In colSettings MsgBox("System Name: " & objComputer.Name) MsgBox("Domain: " & objComputer.Domain) Next