The search for DPM tape utilities stops here… - The Official System Center Data Protection Manager Team Blog - Site Home - TechNet Blogs

The search for DPM tape utilities stops here…

The search for DPM tape utilities stops here…

  • Comments 16
  • Likes

This solution combines several existing tape related scripts with enriched functionality. The short list is shown in the DPMTapeUtil user guide illustration on the right. You can download the script and user guide from here, provided “as is” no rights or warranties implied.

This script is updated to also copy recovery points to disk and to copy only the latest recovery point across media to disk!

The “DPMTapeUtil.Ps1” script performs a variety of tape related functions such as; report recovery points, start inventory, mark free, erase, eject, re-catalog, rescan library,  run a one-off backup and more… These functions can be used individually or in combinations, interactively on the DPM server or scheduled on multiple DPM servers. Tape selection and scheduling are controlled through simple command definitions. For instance to erase tapes that are ‘Recyclable’ every Sunday at 04:00 AM;

-tapeerase –schedule “Enable|Weekly|Sun|04:00” 

This only works with tapes DPM can understand, to erase tapes with an unsupported block size, see this companion post.

Why or when would you use this?

Although the DPM UI has good multi-select features, selecting a larger collection of tapes to perform the same action through this script can be more convenient. This is particularly true with good criteria such as; commonality in displayed label or barcode, a timespan or particular state the tapes can have. For instance; all tapes in all libraries across multiple servers with expired data, or that are offsite ready, or have written less than or at least certain amount of data and so forth…

The UI does not produce raw data about recovery points or tapes that can be easily imported in Excel or other program to process further. Obviously a UI does not return information for automation. This script returns object collections you can use in your own scripts such as selected tapes, triggered jobs, created output files….

Executing multiple actions on the same set of tapes, for instance mark free, erase and eject can be cumbersome when individual steps take a long time and must complete before the next step can be executed. Such activities often also need to happen on predictable times or conditions were this script can be used to automate that. This script can schedule itself using a simplified “Task Manager” specification as shown above that creates jobs on one or more DPM servers running the desired functions.

You would typically not use this script for ad-hoc activities which are just as easily if not easier done through the UI.

Full link: 

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Great job guys! I'm really glad of this tool.


  • ist there no tool / script that eject a Tape in a single Drive (not Library). This script dont do this.

  • Friends,

    sorry for late response, somehow missed updates.

    All bug comments have been fixed in v3.6.


  • Hello,

    this script unloads a tape from a drive and causes eject on standalone tape drives;  

  • Hello, I'm running DPM 2007 and I'm having some problem getting the DPMTapeUtil.ps1 script to run.  I'm getting the following error message:

    Missing expression after unary operator '-'.

    At C:\Temp_Install\Powershell_scripts\DPMTapeUtil.ps1:70 char:31

    +     if ($msg -ne $null) {$msg = -j <<<< oin ($msg)}

    I'm running DPM 2007.  The line in question is referencing -join command.  Any suggestions to work around this issue would be appreciated.


  • Hello the url has expired for the

    Please could someone upload it again.


  • This tool is absolutely awesome.  You can find the download from the following link:


    you should be able to run the script for the command prompt by doing the following:

    Since the script was created on a different machine, you will first need to unlock the script.

    - go to the storage location of the file

    - right-click on the file and select properties

    - at the bottom of the properties window, click on UNBLOCK.

    To run the script, open PowerShell and browse to the location of the file

    - i.e. cd C:\Temp_Install\Powershell_scripts

    - type the following to run the srcipt: .\DPMTapeUtil.ps1 -noexit

    Give that try and let us know if you're still having any issues.

  • If you are using Windows 2008 R2 and DPM 2010, then the best solution is to get your tape symbolic name by running powershell command:

    get-dpmlibrary -dpmservername talba | get-tapedrive | ft acc*

    Then download the small utility devioctl from and run the command

    devioctl.exe eject \\.\Tape2147483646

    If the tape number is different, change it according to first command

  • It appears that this utility does not work for DPM 2012, is there a plan to modify it to do so?


  • We were able to get it to work in DPM 2012 by opening the dpmtapeutil.ps1 and removing the folling lines.

    if ((Get-DPMGlobalProperty (&hostname) "OptimizeTapeUsage") -eq "True" ) {

    $tmp = ""

    [boolean]$global:tapecolocation = $false


    else {

    $tmp = " NOT"

    [boolean]$global:tapecolocation = $true


    writelog "Tape colocation IS$($tmp) enabled on local server!"

  • I am upgrading from a dpm 2010 sever to a new 2012 server.  This utility works great on my dpm 2010 server.  Thanks for providing it.  It reports the following error when trying to run it from dpm 2012.  Any comments on how to fix it for 2012/.  Thanks.   "[05/07/2012 13:52.20] TRAP:  Cannot bind parameter 'PropertyName'. Cannot conver

    t value "OptimizeTapeUsage" to type "Microsoft.Internal.EnterpriseStorage.Dls.UI

    .Cmdlet.GlobalProperties" due to invalid enumeration values. Specify one of the

    following enumeration values and try again. The possible enumeration values are

    "IsNetworkChecksumRequired, TruncateSharePointDbLogs, LibraryRefreshInterval, Ex

    changeSCRProtection, AllowLocalDataProtection, RegisteredWriters, ConsiderForAut

    oDeployment, MaxCapacityForClientAutoDeployment".

  • Oops.  Just noticed the other comments.  Will try that.

  • Thanks for the great tool.  Is there a way to generate a list of all tapes and when they are do back?

    Thanks again.


  • Great tool, tried numerous scripts to try and forcibly mark tape as free. This is the only one that succeeded.

  • How can i use this in a script to mark tapes as free and automatically answer the yes/no questions ?

    I ran this to forcefree tapes in my repository and that worked.