DPM Tape List with ExpireDate, Barcode, Location, Name and recommended Action

This Script will read all Tapes in SCDPM, doesnt matter if they are in the Library or outside. So you will get a List of all your Tapes with Expire Date Name Slot Number Barcode recommended Action At the End yout get additional Informations about How many free Tapes are in your

 
 
 
 
 
4.6 Star
(5)
2,294 times
Add to favorites
System Center
5/30/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Problems with the script since upgrade to SQL 2012 SP4
    1 Posts | Last post January 09, 2018
    • Hi ,
      
      I've been using the script for a very long time now and it's the best!
      But now I have a problem.
      
      I get this error while running it :
      
      Cannot index into a null array.
      At D:\Get_tapes_script\GetDPMTapeList.ps1:73 char:5
      +     $ExpDate = $RPs[0].recoverysourcelocations[0].expirydate
      +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
          + FullyQualifiedErrorId : NullArray
      
      The file is generated but I'm missing information I cannot see the tapes expired before 8/1/2017 ?
      
      
  • Having error while running this script
    2 Posts | Last post July 24, 2015
    • Below mentioned is error details, need help to resolve them.
      
      
      Out-File : Cannot find drive. A drive with the name 'D' does not exist.
      At E:\ProgramFiles\Microsoft System Center 2012
      R2\DPM\DPM\bin\GetDPMTapeList.ps1:65 char:36
      + "Expire;Name;Slot;Barcode,Action"| Out-File -FilePath $File -Append
      +                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (D:String) [Out-File], DriveNotF
         oundException
          + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.OutF
         ileCommand
      
      Cannot index into a null array.
      At E:\ProgramFiles\Microsoft System Center 2012
      R2\DPM\DPM\bin\GetDPMTapeList.ps1:73 char:5
      +     $ExpDate = $RPs[0].recoverysourcelocations[0].expirydate
      +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
          + FullyQualifiedErrorId : NullArray
    • Hi,
      
      please change the Destination of the Output File in the Script.
  • Running this as a scheduled task
    4 Posts | Last post June 09, 2015
    • I cannot execute this script as a batch or directly as a task. 
      No matter how I launch it in a batch, it always fails to read the computername from environment variables. 
      I have tried : 
      C:\...\powershell.exe -noexit -File "C:\TOOLS-DPM\GetDPMTapeList.ps1" | "C:\Program Files\Microsoft DPM\DPM\bin\dpmcliinitscript.ps1"
      
      I get : 
      ---------------------
      Windows PowerShell
      Copyright (C) 2014 Microsoft Corporation. All rights reserved.
      
      cmdlet Get-DPMProtectionGroup at command pipeline position 1
      Supply values for the following parameters:
      DPMServerName:
      =========================
      
      If I launch it directly, then I get a ton of errors roll by. (can provide on request, but I suspect it is not expected to work like that.). 
      
      I have tried setting the computer name in the script but it just ignores it and keeps asking for dpmserver name and as such I cannot use it in a scheduled task. 
      
      I tried : (separately) 
      $DPMServer=$env:COMPUTERNAME
      $DPMServer="Corporate-DPM.contoso.com"
       and in >>
      #Settings
      $Library=Get-DPMLibrary -DPMServerName "Corporate-DPM.contoso.com"
      
    • please provide the errormessages
    • Error list when launching the script by "Run with PowerShell" option (from right click the script file)
      ------
      PS C:\Users\me> C:\TOOLS-DPM\getdpmtapelist.ps1
      Get-ItemProperty : Requested registry access is not allowed.
      At C:\Program Files\Microsoft DPM\DPM\bin\Modules\DataProtectionManager\DataProtectionManager.psm1:1 char:19
      + $cmdletDllPath = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Microsoft Data Prot ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...n Manager\Setup:String) [Get-ItemProperty], SecurityException
          + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.GetItemPropertyCommand
      
      Join-Path : Cannot bind argument to parameter 'Path' because it is null.
      At C:\Program Files\Microsoft DPM\DPM\bin\Modules\DataProtectionManager\DataProtectionManager.psm1:2 char:26
      
      ... <snipped many others cascading from the above>
      ===================================
      
      Taking a second look this morning it seems like they were because of not running the script in an elevated powrshell. 
      Running it in elevated powershell again appears to bring me to the same issue of  not populating the script variable with system var value : ($DPMServer=$env:COMPUTERNAME)
      
      --------------------------
      PS C:\Windows\system32> C:\TOOLS-DPM\getdpmtapelist.ps1
      
      cmdlet Get-DPMProtectionGroup at command pipeline position 1
      Supply values for the following parameters:
      DPMServerName:
      >>Press enter without providing value gives errors>>
      
      Get-DPMProtectionGroup : Cannot validate argument on parameter 'DPMServerName'. The argument is null or empty. Provide
      an argument that is not null or empty, and then try the command again.
      At C:\TOOLS-DPM\GetDPMTapeList\getdpmtapelist.ps1:56 char:8
      
      I need it to run without prompt.
    • Hi,
      there is a Permission Problem, try to execute Script as Admin