2009. 6. 22. 16:30
서버 이름 쿼리 VBS Etc.2009. 6. 22. 16:30
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objItem In colItems
WScript.Echo "ServerName: " & objItem.CSName
Next
Set colItems = NOTHING
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objItem In colItems
WScript.Echo "ServerName: " & objItem.CSName
Next
Set colItems = NOTHING