Hey All,
One of my colleagues is managing a rather large environment on a daily base. He has to manage two backup solutions (HP Data Protector and SCDPM) that share one tape library. From time to time, he need to set a tape not free in that library (Otherwise SCDPM will use that tape while it is needed for the HP solution). To do his work faster, he created a small powershell script where he has to give the name of the slot in order to mark that tape as not free.
So here it is:
$LIB = Get-DPMLibrary -DPMServerName "<servernaam>"
$TP1 = Get-Tape -DPMLibrary $LIB
$TapeLocationList = Read-Host "Tape location (Slot-x) "
foreach ($media in $TP1)
{
if ($TapeLocationList -contains $media.Location)
{
Set-Tape -Tape $media -NotFree
Echo "Tape in $($media.Location) marked as NOT FREE."
}
else
{
Echo "Tape in location $($media.Location) is not in requested slot."
}
}
Enjoy
Cheers,
Mike
PS: Thanks to Steven Van der Taelen for writing this script
Read the complete post at http://scug.be/blogs/scdpm/archive/2009/12/21/system-center-data-protection-manager-cool-script.aspx