Get online media

PowerShell script exchange

Get online media

Veeam Logoby joergr » Mon Nov 10, 2014 7:07 pm

Hi,

with V8 the tape scripting has lightly changed. When using V7 you can read the tapes online at THIS time (i want to know the medium which is IN the tape now) with

Code: Select all
get-vbrtapemedium | Where-Object {$_.IsOnline -like "True"}


With V8 the result returns empty, because the Object "IsOnline" is gone with V8. Any Ideas how to accomplish this task?

Workaround: I need a command to erase everything it finds in the tape drives at the time the command is issued.

Best regards,
Joerg
joergr
Expert
 
Posts: 377
Liked: 39 times
Joined: Tue Jun 08, 2010 2:01 pm
Full Name: Joerg Riether

Re: Get online media

Veeam Logoby joergr » Mon Nov 10, 2014 8:14 pm

Come on, there *has* to be a more elegant way like such thing here:

Code: Select all
$drives = get-vbrtapedrive
foreach ($drive_id in $drives)
{
$medium = get-vbrtapemedium -drive $drive_id
Erase-VBRTapeMedium -Medium $medium -confirm:$false   
}

so *please* think with me ;-)

Best regards,
Joerg
+
joergr
Expert
 
Posts: 377
Liked: 39 times
Joined: Tue Jun 08, 2010 2:01 pm
Full Name: Joerg Riether

Re: Get online media

Veeam Logoby v.Eremin » Tue Nov 11, 2014 8:47 am 1 person likes this post

What about using media location parameter?

Code: Select all
Get-VBRTapeMedium | where {$_.location -like "Drive"}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get online media

Veeam Logoby joergr » Tue Nov 11, 2014 9:07 am 1 person likes this post

What a nice idea!!! ;-) Thanks Vladimir - that does it.
joergr
Expert
 
Posts: 377
Liked: 39 times
Joined: Tue Jun 08, 2010 2:01 pm
Full Name: Joerg Riether

Re: Get online media

Veeam Logoby v.Eremin » Tue Nov 11, 2014 9:14 am

You're welcome. By the way, I've moved the topic to the corresponding subforum and renamed it for the convenience of future readers.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests