This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
strComputer = "." | |
Set objWMIService = GetObject("winmgmts:" _ | |
& "{impersonationLevel=impersonate}!\\" _ | |
& strComputer & "\root\cimv2") | |
Set colSettings = objWMIService.ExecQuery _ | |
("Select * from Win32_ComputerSystem") | |
For Each objComputer in colSettings | |
Wscript.Echo "System Name: " & objComputer.Name | |
Wscript.Echo "Domain: " & objComputer.Domain | |
Next |