Browse Community
Language
Help
Sign In
Posts
Users
Search
stewharr
updated
13 years ago
25 Posts
0
21310
March 28th, 2014 15:00
What would be the best way to list all volumes with no replays? Thanks.
Responses (1)
Solutions (0)
Justin Braun
7 Posts
436
Posted April 22nd, 2014 13:00
This code you give you the concepts you need to collect volumes with no replays. You can shorten up the code in spots, but I am providing it in long form to demonstrate the concepts.
<# Connection #>
$conn = Get-SCConnection -HostName "sctest" -User Admin
<# Get list of volumes #>
foreach($volume in $(Get-SCVolume -Connection $conn))
{
<# Get replays #>
$volreplays = Get-SCReplay -SourceSCVolume $volume -Connection $conn | where {$_.State -eq "Frozen"} | Sort-Object $_.CreateTime -Descending
if($volreplays.count -eq 0)
<# Output volume name #>
$volume.Name
}
Good Luck!
Justin
Self Repair, Upgrade & Maintain
Diagnostics and Tools
Drivers & Downloads
Solve
PowerEdge HDD/SCSI/RAID
12
1
Alienware Desktops
30
7
Monitors
6
2
Productivity Software
50
3
General Discussion
4
View More
Justin Braun
7 Posts
436
0
Posted April 22nd, 2014 13:00
This code you give you the concepts you need to collect volumes with no replays. You can shorten up the code in spots, but I am providing it in long form to demonstrate the concepts.
<# Connection #>
$conn = Get-SCConnection -HostName "sctest" -User Admin
<# Get list of volumes #>
foreach($volume in $(Get-SCVolume -Connection $conn))
{
<# Get replays #>
$volreplays = Get-SCReplay -SourceSCVolume $volume -Connection $conn | where {$_.State -eq "Frozen"} | Sort-Object $_.CreateTime -Descending
if($volreplays.count -eq 0)
{
<# Output volume name #>
$volume.Name
}
}
Good Luck!
Justin