none
Using DPMeraseTape.ps1 utility RRS feed

  • Question

  • Hello,

    Attempting to use the DPMeraseTape.ps1 utility.  I'm running DPM 2012 SP1 with UR7 installed.  I downloaded the script and extracted it to "D:\DPMeraseTape."  I am using a Qualstar RLS-8236 Tape Library (That name is exactly how DPM sees it as well)

    I tried running it by performing the following, but I receive an error:

    PS D:\DPMeraseTape> .\DPMeraseTape.ps1 -slot 4 libkey "RLS-8236"

    At D:\DPMeraseTape\DPMeraseTape.ps1:30 char:20
    +     writelog $("TRAP: $TN: $Error") red
    +                       ~~~~
    Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to delimit the name.
    At D:\DPMeraseTape\DPMeraseTape.ps1:35 char:25
    +     $log.WriteEntry("TRAP: $TN: $msg", [system.Diagnostics.EventLogEntryType]::Erro ...
    +                            ~~~~
    Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${} to delimit the name.
        + CategoryInfo          : ParserError: (:) [], ParseException
        + FullyQualifiedErrorId : InvalidVariableReferenceWithDrive

    I assume the error is with the library name (libkey) but I can't figure out what to type there.  I've tried "Qualstar," "Qual," "Library," "Tape Library," "RLS," and "8236."  Nothing seems to work.

    Can someone point out where I'm going wrong?  Thanks.

    Tuesday, October 21, 2014 5:36 PM

Answers

  • Hi,

    Delete or comment (#) out these two lines.

    # writelog $("TRAP: $TN: $Error") red
    # $log.WriteEntry("TRAP: $TN: $msg", [system.Diagnostics.EventLogEntryType]::Error,9911)


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, October 21, 2014 8:30 PM
    Moderator
  • Hi,

    Just try this.

    .\DPMeraseTape.ps1 -slot 4 RLS-8236


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, October 21, 2014 9:54 PM
    Moderator

All replies

  • Hi,

    Delete or comment (#) out these two lines.

    # writelog $("TRAP: $TN: $Error") red
    # $log.WriteEntry("TRAP: $TN: $msg", [system.Diagnostics.EventLogEntryType]::Error,9911)


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, October 21, 2014 8:30 PM
    Moderator
  • Thanks Mike!  That got the script to work!

    However, now I have THIS error...do I enclose the entire friendly name (libkey) in quotes?  Or no?

    [10/21/2014 3:40:56 PM] DPMeraseTape V1.2
    [10/21/2014 3:40:56 PM] ======================
    At D:\DPMeraseTape\DPMeraseTape.ps1:209 char:12
    +     $libs = @(Get-DPMLibrary (&hostname) | ? {!$_.IsOffline})
    +               ~~~~~~~~~~~~~~

    Tuesday, October 21, 2014 8:45 PM
  • Hi,

    Just try this.

    .\DPMeraseTape.ps1 -slot 4 RLS-8236


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, October 21, 2014 9:54 PM
    Moderator
  • Hello Mike,

    The script kept throwing errors, so I used the MCT.exe and Mytape.exe utilities to accomplish the task.

    Thanks for your assistance.

    Wednesday, October 22, 2014 4:32 PM