UNSOLVED

stewharr

updated

13 years ago

S

stewharr

25 Posts

0

21310

March 28th, 2014 15:00

List volumes with no replays

What would be the best way to list all volumes with no replays?  Thanks.

  • 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