none
need a tape report RRS feed

  • Question

  • Is there any way to get a report that shows the bar code, tape label and protection group of ALL tapes that have been used in DPM 2010?  I have a powershell script that shows this info for the tapes currently in the library but I want to see this for all the tapes that are not in the library (the monthly backups that are offsite).  Can anyone help me out?
    Wednesday, September 21, 2011 3:56 PM

Answers

  • Hi,

    Does the tape utilization report help you ?

    If not, try this script.  Change the $ReportWindow variable to fit your needs - default is 90 days.

    #### Change these params as per your needs.####################
    #$confirmpreference = "None"
    
    	$DPMservername=&"hostname"
    	$ReportWindow = 90
    
    	##############################################################
    
    	$con = Connect-dpmserver $DpmServerName
    	$PGlist =  get-protectiongroup -dpmservername $DpmServerName
    	$tapesList = New-Object System.Collections.ArrayList;
    	cls
    	#Get all tapes used by each PG.
    	foreach($pg in $pgList)
    	{
    		Write-host " "
    		Write-host "Tape List for PG name:" $pg.Friendlyname
    		$tapes = get-tape -protectiongroup $pg
    		foreach($tape in $tapes)
    		{ $flag =0
    			foreach($t in $tapesList)
    			{
    				if($t -and $tape.Barcode.Value -eq $t.Barcode.Value)
    				{	
    					$flag =1				
    					break;
    				}	
    			}
    			
    			#Make sure tape list is distinct elements and doesnt have repetations
    			if($tape -and $flag -eq 0)
    			{
    				#$tape.Barcode.Value
    				$i = $tapesList.Add($tape);
    				Write-host $tape.Barcode.Value
    			}
    		}
    		#Write-host "completed for PG.. " + $pg.Friendlyname
    		
    	}
    
    	" "
    	"Total DPM Used active tape count " +  $tapesList.count
    	"Tapes that were used in past [$reportWindow] days are:"
    	" "
    	"--Barcode--`t--SLOT NUM --"
    
    	foreach($tape in $tapesList)
    	{ 	$flag =0
    		$tapeRP = Get-recoverypoint -tape $tape | sort-object RepresentedPointInTime
    		if ($tapeRP.Count -gt 0)
    		{
    			if($tapeRP[$tapeRP.Count - 1].RepresentedPointInTime -ge ([DateTime]::UtcNow).AddDays([int](-$ReportWindow)))  #change here for no.of days
    			{
    				$flag = 1			
    			}
    		}			
    		if($tapeRP.Count -eq 0)
    		{
    			"No Rps in Last $ReportWindow Days on Tape " + $tape.Barcode.Value.Tostring()
    		}
    		if($flag -eq 1)
    		{
    			if($tape.Location.Isoffline -eq $false)
    			{
    				$tape.Barcode.Value.Tostring() + "`t `t" + $tape.Location.Id.Tostring()
    			}
    			else
    			{
    				$tape.Barcode.Value  +  "`t `t Offline"
    			}	
    		}
    	}
    
    

    Sample output, tapes that are offline should show offline instead of slot number.

    Tape List for PG name: HyperV

    A88004
    A81000
    A88001
    A81001
    A81002
    A88003
    A81003

    Tape List for PG name: LOCAL Hyper-V

    Tape List for PG name: HYPER-V-DPMS

    A88002
    A88000

    Tape List for PG name: HYPER-V-DCS

    Tape List for PG name: 30 million files

    A81004

    Total DPM Used active tape count 10

    Tapes that were used in past [90] days are:

    --Barcode--     --SLOT NUM --

    A88004          5
    A81000          1
    A88001          2
    A81001          6
    A81002          7
    A88003          4
    A81003          8
    A88002          3
    A88000          10


    Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, September 22, 2011 2:25 AM
    Moderator

All replies

  • Hi,

    Does the tape utilization report help you ?

    If not, try this script.  Change the $ReportWindow variable to fit your needs - default is 90 days.

    #### Change these params as per your needs.####################
    #$confirmpreference = "None"
    
    	$DPMservername=&"hostname"
    	$ReportWindow = 90
    
    	##############################################################
    
    	$con = Connect-dpmserver $DpmServerName
    	$PGlist =  get-protectiongroup -dpmservername $DpmServerName
    	$tapesList = New-Object System.Collections.ArrayList;
    	cls
    	#Get all tapes used by each PG.
    	foreach($pg in $pgList)
    	{
    		Write-host " "
    		Write-host "Tape List for PG name:" $pg.Friendlyname
    		$tapes = get-tape -protectiongroup $pg
    		foreach($tape in $tapes)
    		{ $flag =0
    			foreach($t in $tapesList)
    			{
    				if($t -and $tape.Barcode.Value -eq $t.Barcode.Value)
    				{	
    					$flag =1				
    					break;
    				}	
    			}
    			
    			#Make sure tape list is distinct elements and doesnt have repetations
    			if($tape -and $flag -eq 0)
    			{
    				#$tape.Barcode.Value
    				$i = $tapesList.Add($tape);
    				Write-host $tape.Barcode.Value
    			}
    		}
    		#Write-host "completed for PG.. " + $pg.Friendlyname
    		
    	}
    
    	" "
    	"Total DPM Used active tape count " +  $tapesList.count
    	"Tapes that were used in past [$reportWindow] days are:"
    	" "
    	"--Barcode--`t--SLOT NUM --"
    
    	foreach($tape in $tapesList)
    	{ 	$flag =0
    		$tapeRP = Get-recoverypoint -tape $tape | sort-object RepresentedPointInTime
    		if ($tapeRP.Count -gt 0)
    		{
    			if($tapeRP[$tapeRP.Count - 1].RepresentedPointInTime -ge ([DateTime]::UtcNow).AddDays([int](-$ReportWindow)))  #change here for no.of days
    			{
    				$flag = 1			
    			}
    		}			
    		if($tapeRP.Count -eq 0)
    		{
    			"No Rps in Last $ReportWindow Days on Tape " + $tape.Barcode.Value.Tostring()
    		}
    		if($flag -eq 1)
    		{
    			if($tape.Location.Isoffline -eq $false)
    			{
    				$tape.Barcode.Value.Tostring() + "`t `t" + $tape.Location.Id.Tostring()
    			}
    			else
    			{
    				$tape.Barcode.Value  +  "`t `t Offline"
    			}	
    		}
    	}
    
    

    Sample output, tapes that are offline should show offline instead of slot number.

    Tape List for PG name: HyperV

    A88004
    A81000
    A88001
    A81001
    A81002
    A88003
    A81003

    Tape List for PG name: LOCAL Hyper-V

    Tape List for PG name: HYPER-V-DPMS

    A88002
    A88000

    Tape List for PG name: HYPER-V-DCS

    Tape List for PG name: 30 million files

    A81004

    Total DPM Used active tape count 10

    Tapes that were used in past [90] days are:

    --Barcode--     --SLOT NUM --

    A88004          5
    A81000          1
    A88001          2
    A81001          6
    A81002          7
    A88003          4
    A81003          8
    A88002          3
    A88000          10


    Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, September 22, 2011 2:25 AM
    Moderator
  • The script worked pretty good.  Since we have tape co-location enabled the results can be a bit screwy.
    Thursday, September 22, 2011 8:39 PM