发个例子:Dim $computer ="192.168.1.25"
Dim $Remoteuser ="administrator"
Dim $Remotepass = "11111"
$strResult=''
$objlocator= ObjCreate("wbemscripting.swbemlocator")
$objWMIService = $objlocator.connectserver($computer,"root/cimv2",$Remoteuser,$Remotepass)
$colItems = $objWMIService.ExecQuery("Select * from Win32_LocalTime")
For $objItem In $colItems
$strResult = $objItem.Month & "/" & _
$objItem.Day & "/" & _
$objItem.Year & _
$objItem.Minute & ":" & _
$objItem.Second & "(MM/DD/YYYY HH:MM:SS)"
Next
MsgBox(0, "", $strResult)
|