How to find all file shares on a cluster?

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
pc_doctor
Posts: 61
Joined: Fri Jun 13, 2008 7:49 am

How to find all file shares on a cluster?

Post by pc_doctor »

How would you format a WMI Query that returns all the file share resources on a Microsoft cluster server?

jvierra
Posts: 14547
Joined: Tue May 22, 2007 9:57 am
Contact:

How to find all file shares on a cluster?

Post by jvierra »

The cluster classes are in //root/MSCluster_Resource.


The shares on the cluster are just shares I believe. If you enumerate the shares then they are on the cluster.

To do it with WMI here is teh PowerSHell code (the easiest code)

Get-WmiObject -namespace rootmscluster -computername CLUSTERNAME -class mscluster_resource | where{$_.type -eq "File Share"}

Which would be a wmi query:

wmiquery = "Select * from MSCluster_Resource where Type='File Share'"


jvierra2008-07-31 11:49:25

User avatar
pc_doctor
Posts: 61
Joined: Fri Jun 13, 2008 7:49 am

How to find all file shares on a cluster?

Post by pc_doctor »

Beautiful. Can you tell me how to find the path associated with each share? Like MYSHARE points to s:mydirmyshare?

jvierra
Posts: 14547
Joined: Tue May 22, 2007 9:57 am
Contact:

How to find all file shares on a cluster?

Post by jvierra »

Did you try MSCluster_ResourceToDisk ?

http://msdn.microsoft.com/en-us/library ... S.85).aspx

jvierra
Posts: 14547
Joined: Tue May 22, 2007 9:57 am
Contact:

How to find all file shares on a cluster?

Post by jvierra »

Here is a good set of clues

uploads/2491/ClusWMI.zip

It's teh MOF for the classes for clustering. It will have all of teh properties and methods. for all classes. Use it to find items that you can google for help.

Much of this is new and undocumented or poorly documented. The Platform SDK has more docs available but few examples.


Locked