PowerShell for Windows Admins

Jan 3 2010   8:36AM GMT

Disks Part 1



Posted by: Richard Siddaway
Tags:
Disks

Disk storage and everything associated with that is a big part of administering our servers. We need to be able to discover, and where necessary, work with the storage system. WMI gives us a number of classes for working with disks

PS> Get-WmiObject -List Win32_*disk* | select name

Name
—-
Win32_LogicalDisk
Win32_MappedLogicalDisk
Win32_DiskPartition
Win32_DiskDrive
Win32_LogicalDiskRootDirectory
Win32_DiskQuota
Win32_LogonSessionMappedDisk
Win32_LogicalDiskToPartition
Win32_DiskDrivePhysicalMedia
Win32_DiskDriveToDiskPartition
Win32_PerfFormattedData_PerfDisk_LogicalDisk
Win32_PerfRawData_PerfDisk_LogicalDisk
Win32_PerfFormattedData_PerfDisk_PhysicalDisk
Win32_PerfRawData_PerfDisk_PhysicalDisk

PS> Get-WmiObject -List Win32_*volume* | select name

Name
—-
Win32_VolumeChangeEvent
Win32_Volume
Win32_VolumeQuota
Win32_VolumeQuotaSetting
Win32_VolumeUserQuota
Win32_ShadowVolumeSupport
Win32_ShadowDiffVolumeSupport

PS> Get-WmiObject -List Win32_*drive* | select name

Name
—-
Win32_DiskDrive
Win32_FloppyDrive
Win32_TapeDrive
Win32_CDROMDrive
Win32_DiskDrivePhysicalMedia
Win32_DiskDriveToDiskPartition

Note that the last list has been edited to exclude those classes to work with drivers

Our starting point has to be the physical drives.

PS> Get-WmiObject -Class Win32_DiskDrive

Partitions : 3
DeviceID   : \\.\PHYSICALDRIVE0
Model      : ST9250320AS ATA Device
Size       : 250056737280
Caption    : ST9250320AS ATA Device

 

As with the Operating System there is a lot of information behind this – details from http://msdn.microsoft.com/en-us/library/aa394132(VS.85).aspx

We’ll dig further into disks in the next series of posts

Technorati Tags: ,,

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: