PowerShell for Windows Admins

Jan 5 2010   1:58PM GMT

Disks Part 2



Posted by: Richard Siddaway
Tags:
Disks

 

Moving swiftly on from last time we can expand the information returned on our disks

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
## Configuration Manager Error Code
$cmec = DATA {
ConvertFrom-StringData -StringData @’
0 = Device is working properly.
1 = Device is not configured correctly.
2 = Windows cannot load the driver for this device.
3 = Driver for this device might be corrupted, or the system may be low on memory or other resources.
4 = Device is not working properly. One of its drivers or the registry might be corrupted.
5 = Driver for the device requires a resource that Windows cannot manage.
6 = Boot configuration for the device conflicts with other devices.
7 = Cannot filter.
8 = Driver loader for the device is missing.
9 = Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.
10 = Device cannot start.
11 = Device failed.
12 = Device cannot find enough free resources to use.
13 = Windows cannot verify the device’s resources.
14 = Device cannot work properly until the computer is restarted.
15 = Device is not working properly due to a possible re-enumeration problem.
16 = Windows cannot identify all of the resources that the device uses.
17 = Device is requesting an unknown resource type.
18 = Device drivers must be reinstalled.
19 = Failure using the VxD loader.
20 = Registry might be corrupted.
21 = System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.
22 = Device is disabled.
23 = System failure. If changing the device driver is ineffective, see the hardware documentation.
24 = Device is not present, not working properly, or does not have all of its drivers installed.
25 = Windows is still setting up the device.
26 = Windows is still setting up the device.
27 = Device does not have valid log configuration.
28 = Device drivers are not installed.
29 = Device is disabled. The device firmware did not provide the required resources.
30 = Device is using an IRQ resource that another device is using.
31 = Device is not working properly. Windows cannot load the required device drivers.
‘@

}

Get-WmiObject -Class Win32_DiskDrive | 
Format-List DeviceID, Status, 
@{Name="Configuration Manager Error Code"; Expression={$cmec["$($_.ConfigManagerErrorCode)"]}},
Index, InterfaceType, 
Partitions, BytesPerSector, SectorsPerTrack, TracksPerCylinder,
TotalHeads, TotalCylinders, TotalTracks, TotalSectors,
@{Name="Disk Size (GB)"; Expression={"{0:F3}" -f $($_.Size/1GB)}}

Most of this script is taken up with defining the configuration error codes!

The other aspects are similar to our OS script.  Now we can know what our physical disks are like we need to look at the logical disks and incorporate that information to get the full story.

Once we have finished with this series on disks I’ll post the scripts so that they can be downloaded.

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: