Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Clear Screen
- cls
- #Add Compellent snap in for powershell functions
- Add-PSSnapin Compellent.StorageCenter.Scripting
- #Gather User variables
- $hostname = "172.31.4.10"
- $user = "v"
- $pass = "V"
- #Connect to compellent
- $connection = Get-SCConnection -HostName $hostname -User $user -password $pass -Save refConn -Default
- $filedate = get-date -uformat "%m-%d-%Y"
- #Save Excell workbook
- get-childitem c:\Reports\ -include *.xls -recurse | foreach ($_) {remove-item $_.fullname}
- #Output Titles
- Write-Host "Volume | Replay Index | Freeze Date | Description"
- #$vollist = get-scvolume | foreach-object {$_.name}
- #write-host $vollist
- $vollist = "Repl of CD_GRP1009"
- $indexlist = @()
- foreach ($volume in $vollist){
- $replaylist = get-screplay -sourcevolumename $volume -state Frozen
- foreach ($replay in $replaylist){
- $replaydate = $replay.freezetime
- if ($replaydate -ne ""){
- #Write-Host "date before parsing $Volume $replaydate"
- $replaydate -as [DateTime] -ne $null
- $replaydate = [DateTime]::Parse($replaydate)
- #Write-Host "date after parsing $replaydate"
- if ((Get-date).Adddays(-4) -gt $replaydate -and $replay.index -ne $null){
- #Document Findings
- $rindex = $replay.index
- $rdescription = $replay.description
- Write-Host "$volume | $rindex | $replaydate | $rdescription"
- $indexlist = $indexlist += $replay.index
- }
- }
- }
- }
- foreach ($index in $indexlist){
- ##############################
- #### EXPIRE REPLAY ###
- ##############################
- #remove-screplay -index $index -confirm:$false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement