Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. #Clear Screen
  2. cls
  3.  
  4. #Add Compellent snap in for powershell functions
  5. Add-PSSnapin Compellent.StorageCenter.Scripting
  6.  
  7. #Gather User variables
  8. $hostname = "172.31.4.10"
  9. $user = "v"
  10. $pass = "V"
  11.  
  12. #Connect to compellent
  13. $connection = Get-SCConnection -HostName $hostname -User $user -password $pass -Save refConn -Default
  14. $filedate = get-date -uformat "%m-%d-%Y"
  15.  
  16. #Save Excell workbook
  17. get-childitem c:\Reports\ -include *.xls -recurse | foreach ($_) {remove-item $_.fullname}
  18.  
  19.  
  20.  
  21. #Output Titles
  22. Write-Host "Volume | Replay Index | Freeze Date | Description"
  23.  
  24. #$vollist = get-scvolume | foreach-object {$_.name}
  25. #write-host $vollist
  26. $vollist = "Repl of CD_GRP1009"
  27. $indexlist = @()
  28.  
  29. foreach ($volume in $vollist){
  30. $replaylist = get-screplay -sourcevolumename $volume -state Frozen
  31.  
  32. foreach ($replay in $replaylist){
  33. $replaydate = $replay.freezetime
  34. if ($replaydate -ne ""){
  35. #Write-Host "date before parsing $Volume $replaydate"
  36. $replaydate -as [DateTime] -ne $null
  37. $replaydate = [DateTime]::Parse($replaydate)
  38. #Write-Host "date after parsing $replaydate"
  39.  
  40. if ((Get-date).Adddays(-4) -gt $replaydate -and $replay.index -ne $null){
  41.  
  42. #Document Findings
  43. $rindex = $replay.index
  44. $rdescription = $replay.description
  45. Write-Host "$volume | $rindex | $replaydate | $rdescription"
  46.  
  47. $indexlist = $indexlist += $replay.index
  48.  
  49.  
  50. }
  51. }
  52. }
  53.  
  54.  
  55. }
  56.  
  57.  
  58.  
  59.  
  60. foreach ($index in $indexlist){
  61.  
  62.  
  63. ##############################
  64. #### EXPIRE REPLAY ###
  65. ##############################
  66. #remove-screplay -index $index -confirm:$false
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement