Here is an example for the first part of your question . It is pasted
together from an MS Technet Script Center example and the approach I
often use to read a text file ...
-------------------------8<-----------------------
Const HARD_DISK = 3
bLog = False ' Display - change to True to log to a file
sServersFile = "Servers.txt"
sLogname = "Servers.log"
s = Now() & vbNewLine
with CreateObject("Scripting.FileSystemObject")
with .OpenTextFile(sServerFile, 1)
arrServers = Split(.ReadAll, vbNewline)
end with ' server names
for each strComputer in arrServers
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk Where DriveType = " _
& HARD_DISK & "")
s = s & strComputer & vbCRLF
For Each objDisk in colDisks
with objDisk
s = s & "DeviceID:"& vbTab & .DeviceID & vbCRLF
s = s & "Free Space:" & vbTab _
& Round(.FreeSpace / (1024^3), 1) & " GB" & vbCRLF
s = s & "Percent Free:" & vbTab _
& Round(100 * .FreeSpace / .Size, 1) & vbCRLF
end with ' objDisk
s = s & vbCRLF
Next ' objDisk
next ' strComputer
if bLog then
.OpenTextFile(sLogName, 8).write s
else
wsh.echo s
end if
end with ' FSO
-------------------------8<-----------------------
The same Technet sampler has this example for gathering cluster node
information ...
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root
\mscluster")
Set colItems = objWMIService.ExecQuery("Select * from MSCluster_Node")
For Each objItem in colItems
Wscript.Echo "Build number: " & objItem.BuildNumber
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Characteristics: " & objItem.Characteristics
Wscript.Echo "Dedicated: " & objItem.Dedicated
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Identifying descriptions: " &
objItem.IdentifyingDescriptions
Wscript.Echo "Name: " & objItem.Name
' parameter list abridged
Wscript.Echo "State: " & objItem.State
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo
Next
This example is intended for use at the command prompt under the
cscript.exe host. I don't know which parameters you require to do
your job or if this fulfills all of your needs.
Look up the Script Center's downloadable samples for the rest of the
parameters and other examples ...
TechNet Script Center Sample Scripts (URL all one line)
http://www.microsoft.com/downloads/details.aspx?FamilyID=b4cb2678-dafb-4e30-b2da-b8814fe2da5a
I also referenced the Scriptomatic HTA tool for information to finish
the first example above. It is available here:
Scriptomatic 2.0
http://www.microsoft.com/downloads/details.aspx?FamilyID=09dfc342-648b-4119-b7eb-783b0f7d1178
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
Dominic
when you work with a cluster service you can determine where is the
resources using the property ".isready" of the disc. If the result is
true then you know what node take the resources in determinate
instant. You can send a email when the result not is that you hold.
reggards