The command to start a fast or detailed inventory using Powershell is not to difficult, the trick is to get the correct name for the tape library.
In the example below we use an additional Powershell command to read the Library name in to a variable.
First we need to list all tape libraries attached to the DPM server. When you have a Tape library attached, you might see the drive listed as well. Note the order the tape libraries are listed.
(replace dpm01 with the name of your DPM server)
PS > get-dpmlibrary -DPMServerName dpm01 Name Drives Slots I/E ports |
Now we read the library details in to the variable $DPMlib
(replace dpm01 with the name of your DPM server)
$dpmlib = get-dpmlibrary -DPMServerName dpm01 |
Using the information collected with the first command we now can start the inventory. The number added to the $DPMlib variable is the order number in which the library is listed, start counting with 0. In this example, the number 1.
Fast inventory:
PS > Start-DPMLibraryInventory -DpmLibrary $dpmlib[1] JobCategory Status HasCompleted |
Detailed inventory:
PS > Start-DPMLibraryInventory -DetailedInventory -DpmLibrary $dpmlib[1] JobCategory Status HasCompleted |
When you use it in a script it will look like this
$dpmlib = get-dpmlibrary -DPMServerName dpm01 |
Great in DPM 2007, doesn't work in DPM 2010 :(
ReplyDeleteI appreciate your post, thanks for sharing the post, i would like to hear more about this in future
ReplyDelete