Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dell OMSA Disk Report PowerShell
<#
Created by: Maverick Sevmont (Erick Sevilla)
This was created in response to a question in "Using PowerShell To Get Physical Disk Info On A Dell Server"
http://itcloudpro.net/2017/01/05/using-powershell-to-get-drive-info-on-a-dell-server/comment-page-1/#comment-491
Thanks to Liam Kemp for shedding some light on how to get the storage info pulled with omreport
# Sample regex and report: https://regex101.com/r/VRR3Hq/3
#>
# 1. Get the omsa disk info and store it in a variable
# $omsa = Get-Content 'C:\temp\SampleOMSAReport.txt' # If you wish you can test this with the SampleOMSAReport txt file within this gist, save in C:\temp or edit the location as needed. Make sure you remove the variable with the same name just below this line!
$omsa = & "C:\Program Files\Dell\SysMgt\oma\bin\omreport.exe" storage pdisk controller=0
# 2. Rejoice on raw regex rampage magical mistery mess code
[regex]$RegexCode = 'ID\s*:\s(?<ID>\d+:\d+:\d+)\s*Status\s*:\s(?<Status>\w+)\s*Name\s*:\s(?<Name>\w+\s\w+\s\d+:\d+:\d+)([\s\S]*?)(?=Failure)Failure\sPredicted\s*:\s(?<FailurePredicted>\w+)([\s\S]*?)(?=Serial)Serial\sNo\.\s*:\s(?<SerialNumber>\w+)'
# 3. Use pure .NET regex awesomeness to match results against regex findings
$RegexParsing = ([regex]::Matches($omsa,$RegexCode))
# 4. Parse values as per regex group names and turn them into precious Objects
$RPtoObjects = $RegexParsing | foreach {new-object PSObject -Property @{ID=($_.Groups["ID"].value); Status=($_.Groups["Status"].value);Name=($_.Groups["Name"].value);FailurePredicted=($_.Groups["FailurePredicted"].value);SerialNumber=($_.Groups["SerialNumber"].value)}}
# 5. Make it look purty
$RPtoObjects | Format-Table Name,ID,Status,FailurePredicted,SerialNumber -AutoSize -Wrap
List of Physical Disks on Controller PERC H730 Mini (Embedded)
Controller PERC H730 Mini (Embedded)
ID : 0:1:0
Status : Ok
Name : Physical Disk 0:1:0
State : Online
Power Status : Spun Up
Bus Protocol : SAS
Media : HDD
Part of Cache Pool : Not Applicable
Remaining Rated Write Endurance : Not Applicable
Failure Predicted : No
Revision : FJ23
Driver Version : Not Applicable
Model Number : Not Applicable
T10 PI Capable : No
Certified : Yes
Encryption Capable : No
Encrypted : Not Applicable
Progress : Not Applicable
Mirror Set ID : Not Applicable
Capacity : 278.88 GB (299439751168 bytes)
Used RAID Disk Space : 278.88 GB (299439751168 bytes)
Available RAID Disk Space : 0.00 GB (0 bytes)
Hot Spare : No
Vendor ID : DELL(tm)
Product ID : ABC123456ABC123
Serial No. : 1AB1ABCD
Part Number : AB1ABCD1ABC1234A1ABCD12
Negotiated Speed : 12.00 Gbps
Capable Speed : 12.00 Gbps
PCIe Negotiated Link Width : Not Applicable
PCIe Maximum Link Width : Not Applicable
Sector Size : 512B
Device Write Cache : Not Applicable
Manufacture Day : 06
Manufacture Week : 07
Manufacture Year : 2017
SAS Address : 1234ABC12A123456
Non-RAID HDD Disk Cache Policy : Not Applicable
Disk Cache Policy : Not Applicable
Form Factor : Not Available
Sub Vendor : Not Available
ISE Capable : No
ID : 0:1:1
Status : Ok
Name : Physical Disk 0:1:1
State : Online
Power Status : Spun Up
Bus Protocol : SAS
Media : HDD
Part of Cache Pool : Not Applicable
Remaining Rated Write Endurance : Not Applicable
Failure Predicted : No
Revision : FJ23
Driver Version : Not Applicable
Model Number : Not Applicable
T10 PI Capable : No
Certified : Yes
Encryption Capable : No
Encrypted : Not Applicable
Progress : Not Applicable
Mirror Set ID : Not Applicable
Capacity : 278.88 GB (299439751168 bytes)
Used RAID Disk Space : 278.88 GB (299439751168 bytes)
Available RAID Disk Space : 0.00 GB (0 bytes)
Hot Spare : No
Vendor ID : DELL(tm)
Product ID : ABC123456ABC123
Serial No. : 1AB1ABCD
Part Number : AB1ABCD1ABC1234A1ABCD12
Negotiated Speed : 12.00 Gbps
Capable Speed : 12.00 Gbps
PCIe Negotiated Link Width : Not Applicable
PCIe Maximum Link Width : Not Applicable
Sector Size : 512B
Device Write Cache : Not Applicable
Manufacture Day : 06
Manufacture Week : 07
Manufacture Year : 2017
SAS Address : 1234ABC12A123456
Non-RAID HDD Disk Cache Policy : Not Applicable
Disk Cache Policy : Not Applicable
Form Factor : Not Available
Sub Vendor : Not Available
ISE Capable : No
ID : 0:1:2
Status : Ok
Name : Physical Disk 0:1:2
State : Online
Power Status : Spun Up
Bus Protocol : SAS
Media : HDD
Part of Cache Pool : Not Applicable
Remaining Rated Write Endurance : Not Applicable
Failure Predicted : No
Revision : D1S2
Driver Version : Not Applicable
Model Number : Not Applicable
T10 PI Capable : No
Certified : Yes
Encryption Capable : No
Encrypted : Not Applicable
Progress : Not Applicable
Mirror Set ID : Not Applicable
Capacity : 278.88 GB (299439751168 bytes)
Used RAID Disk Space : 278.88 GB (299439751168 bytes)
Available RAID Disk Space : 0.00 GB (0 bytes)
Hot Spare : No
Vendor ID : DELL(tm)
Product ID : ABC123456ABC123
Serial No. : 1AB1ABCD
Part Number : AB1ABCD1ABC1234A1ABCD12
Negotiated Speed : 6.00 Gbps
Capable Speed : 6.00 Gbps
PCIe Negotiated Link Width : Not Applicable
PCIe Maximum Link Width : Not Applicable
Sector Size : 512B
Device Write Cache : Not Applicable
Manufacture Day : 01
Manufacture Week : 30
Manufacture Year : 2012
SAS Address : 50014EE755586D2A
Non-RAID HDD Disk Cache Policy : Not Applicable
Disk Cache Policy : Not Applicable
Form Factor : Not Available
Sub Vendor : Not Available
ISE Capable : No
ID : 0:1:3
Status : Ok
Name : Physical Disk 0:1:3
State : Online
Power Status : Spun Up
Bus Protocol : SAS
Media : HDD
Part of Cache Pool : Not Applicable
Remaining Rated Write Endurance : Not Applicable
Failure Predicted : No
Revision : D1S2
Driver Version : Not Applicable
Model Number : Not Applicable
T10 PI Capable : No
Certified : Yes
Encryption Capable : No
Encrypted : Not Applicable
Progress : Not Applicable
Mirror Set ID : Not Applicable
Capacity : 278.88 GB (299439751168 bytes)
Used RAID Disk Space : 278.88 GB (299439751168 bytes)
Available RAID Disk Space : 0.00 GB (0 bytes)
Hot Spare : No
Vendor ID : DELL(tm)
Product ID : ABC123456ABC123
Serial No. : 1AB1ABCD
Part Number : AB1ABCD1ABC1234A1ABCD12
Negotiated Speed : 6.00 Gbps
Capable Speed : 6.00 Gbps
PCIe Negotiated Link Width : Not Applicable
PCIe Maximum Link Width : Not Applicable
Sector Size : 512B
Device Write Cache : Not Applicable
Manufacture Day : 07
Manufacture Week : 29
Manufacture Year : 2012
SAS Address : 1234ABC12A123456
Non-RAID HDD Disk Cache Policy : Not Applicable
Disk Cache Policy : Not Applicable
Form Factor : Not Available
Sub Vendor : Not Available
ISE Capable : No
ID : 0:1:4
Status : Ok
Name : Physical Disk 0:1:4
State : Online
Power Status : Spun Up
Bus Protocol : SAS
Media : HDD
Part of Cache Pool : Not Applicable
Remaining Rated Write Endurance : Not Applicable
Failure Predicted : No
Revision : D1S2
Driver Version : Not Applicable
Model Number : Not Applicable
T10 PI Capable : No
Certified : Yes
Encryption Capable : No
Encrypted : Not Applicable
Progress : Not Applicable
Mirror Set ID : Not Applicable
Capacity : 278.88 GB (299439751168 bytes)
Used RAID Disk Space : 278.88 GB (299439751168 bytes)
Available RAID Disk Space : 0.00 GB (0 bytes)
Hot Spare : No
Vendor ID : DELL(tm)
Product ID : ABC123456ABC123
Serial No. : 1AB1ABCD
Part Number : AB1ABCD1ABC1234A1ABCD12
Negotiated Speed : 6.00 Gbps
Capable Speed : 6.00 Gbps
PCIe Negotiated Link Width : Not Applicable
PCIe Maximum Link Width : Not Applicable
Sector Size : 512B
Device Write Cache : Not Applicable
Manufacture Day : 06
Manufacture Week : 28
Manufacture Year : 2012
SAS Address : 1234ABC12A123456
Non-RAID HDD Disk Cache Policy : Not Applicable
Disk Cache Policy : Not Applicable
Form Factor : Not Available
Sub Vendor : Not Available
ISE Capable : No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.