Location: List Archives

List Archives

This forum is an archive of all posts to our mailing list over the past few years.  The forum is set read only therefore to contribute you will need to join our list community.  See more info about this here.

 

When subscribed to the list you should use your standard email client to send your posts to ActiveDir@mail.activedir.org.

List Archives

Subject: [ActiveDir] Script for checking HDD size
Prev Next
You are not authorized to post a reply.

AuthorMessages
nidhinckUser is Offline

Posts:64

07/29/2010 3:26 PM  
Hi All,

I'm looking for a script which will pull the size of Physical HDD from list
of servers.

--
Regards,

Nidhin.CK
Chennai
Phone No: +91 9884622467

steadyUser is Offline

Posts:1

07/29/2010 3:32 PM  
Nidhin

you could write a WMI script to read this info

example below:
http://www.computerperformance.co.uk/vbscript/wmi_disks.htm

Connect to remote computer with WMI:

http://msdn.microsoft.com/en-us/library/aa389290(VS.85).aspx

Hope this helps

On Thu, Jul 29, 2010 at 10:23 AM, nidhin ck <nidhinck@gmail.com> wrote:

> Hi All,
>
> I'm looking for a script which will pull the size of Physical HDD from list
> of servers.
>
> --
> Regards,
>
> Nidhin.CK
> Chennai
> Phone No: +91 9884622467
>
>
>

joepochedleyUser is Offline

Posts:16

07/29/2010 4:19 PM  
One question... What info are you really trying to get?

Remember that server disks are very often not "just" physical disks... Often the physical disks are connected to RAID controllers. Those RAID controllers present something different to the operating system than the actual physical disks... A RAID5 set of 3x143 GB disks might appear to the OS, and WMI, as a single 240GB physical disk. Hence, if you only want what the RAID adapter presents to Windows, then WMI will work fine...

However, if you want to actually get reports on the physical spindles then you need to look at the tools provided by the RAID adapter manufacturer as most don't have WMI libraries. You'd need to see if there are command line tools, and then integrate those into your script by parsing through the output. It's ugly, but it can be done.

JP

From: activedir-owner@mail.activedir.org [mailto:activedir-owner@mail.activedir.org] On Behalf Of David Steadman
Sent: Thursday, July 29, 2010 10:32 AM
To: activedir@mail.activedir.org
Subject: Re: [ActiveDir] Script for checking HDD size

Nidhin

you could write a WMI script to read this info

example below:
http://www.computerperformance.co.uk/vbscript/wmi_disks.htm

Connect to remote computer with WMI:

http://msdn.microsoft.com/en-us/library/aa389290(VS.85).aspx

Hope this helps
On Thu, Jul 29, 2010 at 10:23 AM, nidhin ck <nidhinck@gmail.com<mailto:nidhinck@gmail.com>> wrote:
Hi All,

I'm looking for a script which will pull the size of Physical HDD from list of servers.

--
Regards,

Nidhin.CK
Chennai
Phone No: +91 9884622467



bsonposhUser is Offline

Posts:408

07/29/2010 4:47 PM  
I have a Get-DiskSpace function in my BSonPosh Powershell module
http://code.msdn.microsoft.com/bsonposh/Release/ProjectReleases.aspx?ReleaseId=4564

On Thu, Jul 29, 2010 at 10:23 AM, nidhin ck <nidhinck@gmail.com> wrote:

> Hi All,
>
> I'm looking for a script which will pull the size of Physical HDD from list
> of servers.
>
> --
> Regards,
>
> Nidhin.CK
> Chennai
> Phone No: +91 9884622467
>
>
>

CrawfordSUser is Offline

Posts:128

07/29/2010 4:58 PM  
The following powershell reads a list of computers from comps.txt and outputs to DiskSpace.html

Import-Csv .\Comps.txt |`
foreach {Get-WmiObject win32_volume -filter "drivetype=3" -computername $_.ComputerName} |`
Select @{Name="Computer"; Expression={$_.SystemName}},`
@{Name="Name"; Expression={$_.Name}},`
@{Name="Capacity"; Expression={($_.Capacity/1GB).ToString("0 GB")}},`
@{Name="FreeSpace"; Expression={($_.FreeSpace/1GB).ToString("0.00 GB")}},`
@{Name="PercentFree"; Expression={((($_.FreeSpace/1GB)/($_.Capacity/1GB))).ToString("00%")}} |`
Sort-Object -Property PercentFree |`
ConvertTo-Html > DiskSpace.html

From: activedir-owner@mail.activedir.org [mailto:activedir-owner@mail.activedir.org] On Behalf Of nidhin ck
Sent: Thursday, July 29, 2010 9:24 AM
To: activedir@mail.activedir.org
Subject: [ActiveDir] Script for checking HDD size

Hi All,

I'm looking for a script which will pull the size of Physical HDD from list of servers.

--
Regards,

Nidhin.CK
Chennai
Phone No: +91 9884622467


r00tb00tUser is Offline

Posts:0

07/29/2010 6:06 PM  
I have a script that runs on a scheduled task and stores free space to
a CSV so I can see how quickly space is being chewed up;

http://pastebin.com/raw.php?i=VHg9Xf53

In the WMI query, chagne 'Win32_LogicalDisk' to 'Win32_DiskDrive' if
your not using a hardware raid and 'arrProperty.FreeSpace' to
'arrProperty.Size' just to get the actual volume size instead of the
free space.

--
Regards,
James.

http://www.jamesbensley.co.cc/

There are 10 kinds of people in the world; Those who understand
Vigesimal, and J others...?

You are not authorized to post a reply.
Forums >ActiveDir Mail List Archive >List Archives > [ActiveDir] Script for checking HDD size



ActiveForums 3.7
Friends

Friends

VisualClickButoton
Members

Members

MembershipMembership:
Latest New UserLatest:MrPTSai
New TodayNew Today:0
New YesterdayNew Yesterday:0
User CountOverall:5234

People OnlinePeople Online:
VisitorsVisitors:29
MembersMembers:0
TotalTotal:29

Online NowOnline Now:

Ads

Copyright 2009 ActiveDir.org
Terms Of Use