Check Harddrive space and total drive listings for all servers

I have a list of servers (actual servers on our network) that I am returning from a SQL stored procedure query via a datareader - what I would like to do is to cycle through of the of records returened and check and display the harddrive space and drives on each of the servers - Is this even possible and if so, how?
tbaseflugAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RonaldBiemansCommented:
maybe look ,

here

http://www.freevbcode.com/ShowCode.Asp?ID=5588

or you could use WMI
0
RonaldBiemansCommented:
sorry forgot the link for wmi

http://www.freevbcode.com/ShowCode.Asp?ID=1550
0
RonaldBiemansCommented:
I see the link for WMI was for VB6,

but this is how it is done in .net (don't forget to reference system.management

Public Function GetDiskSpace() As System.UInt64
Dim diskClass As _
New System.Management.ManagementClass("Win32_LogicalDisk")
Dim disks As System.Management.ManagementObjectCollection = _
diskClass.GetInstances()
Dim disk As System.Management.ManagementObject
Dim space As System.UInt64
For Each disk In disks
If CStr(disk("Name")) = "C:" Then
space = CType(disk("FreeSpace"), System.UInt64)
End If
Next disk
Return space
End Function
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

tbaseflugAuthor Commented:
RonaldBiemans -

How would I displaythe results to a web page?
0
tbaseflugAuthor Commented:
Also, how would I use the above to reference a harddrive of a remote server?
0
The_BiochemistCommented:
'create your string from the variables
Dim strOutput as string = disk & " has " & space & " kb Free"
'write it to the page
response.write(strOutput)
0
The_BiochemistCommented:
in the interim before finding out how to  reference the drives on a remote server with code you could map them as local drives and set the permissions for ASPNET. It is not the best solution but certainly the easiest!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.