DPM CLI Tips 'n Tricks: Powershell Basics

Published Feb 14 2019 08:25 PM 106 Views
First published on TECHNET on Jun 18, 2008

The scripts posted in this blog require knowledge of Powershell and DPM cmdlets. So we thought we would present some tips ‘n tricks to become power users!







Introduction



The first difference between any normal Command Line Interface (CLI) (typically, Windows cmd.exe based environment) & Powershell is that, Powershell is a full blown .Net environment and is object oriented. In other words, it treats all input/output parameters as objects and when you pipe one command to another, objects flow instead of plain text as in old shells. Similarly, DPM Management Shell also takes inputs in the form of objects – for example, DPM, Protection Group, Datasource, Library, Tape, Tape Drive, Disk etc. are all .Net objects. Let’s now move on to more interesting stuff.





Finding cmdLets (Get-Command or gcm)



For knowing all the cmdLets present in the Powershell instance, use Get-Command (or gcm in short). When run, the output will be something like this:





PS D:\ > Get-command





CommandType   Name                  Definition



-----------       ----                   ----------



Cmdlet              Add-Content       Add-Content [-Path] <String[...



Cmdlet              Add-DPMDisk       Add-DPMDisk [-DPMDisk] <Disk...



Cmdlet              Add-History         Add-History [[-InputObject] ...



Cmdlet              Add-Member        Add-Member [-MemberType]



Cmdlet              Add-PSSnapin      Add-PSSnapin [-Name] <String...



Cmdlet              Add-Tape            Add-Tape [-DPMLibrary] <Libr...



Cmdlet              Clear-Content      Clear-Content [-Path] <Strin...





Finding DPM cmdLets (Get-DPMCommand)



Similarly for getting all the cmdLets belonging to only DPM, use the Get-DPMCommand .





PS D:\ > Get-DPMCommand





CommandType  Name                      Definition



-----------      ----                        ----------



Cmdlet            Add-DPMDisk             Add-DPMDisk [-DPMDisk] <Disk...



Cmdlet            Add-Tape                 Add-Tape [-DPMLibrary] <Libr...



Cmdlet            Connect-DPMServer   Connect-DPMServer [-DPMServe...



Cmdlet            Disable-DPMLibrary     Disable-DPMLibrary [-DPMLibr...



Cmdlet            Disable-TapeDrive      Disable-TapeDrive [-TapeDriv...





How to use a cmdlet?





1. Understanding the cmdlet parameters (Get-Command and Format-List)



There are two parts to understanding a cmdlet. First, to look at the various input parameters and various usages, you can use the Get-Command itself on a specific cmdlet, in the following fashion – Get-Command <cmdlet> | format-list (or gcm <cmdlet> | fl , in short).





PS C:\> gcm Set-Alias | fl





Name                     : Set-Alias



CommandType         : Cmdlet



Definition                : Set-Alias [-Name] <String> [-Value] <String> [-Description <String>] [-Option <ScopedItemOptions>] [-PassThru] [-Scope <String>] [-Force] [-Verbose] [-Debug] [-ErrorAction <ActionPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-WhatIf] [-Confirm]







2. Reading Help documentation for a cmdlet (Get-Help or help)



For reading the Help documentation for any cmdlet use the following ( Get-Help or help )





Get-Help <cmdlet>





For example:





PS D:\ > Get-Help Add-Tape





NAME



Add-Tape





SYNOPSIS



Adds a tape to a DPM library.







SYNTAX



Add-Tape [-DPMLibrary] <Library> [-Async] [-JobStateChangedEventHandler <Jo



bStateChangedEventHandler>] [<CommonParameters>]



…..





3. Getting detailed help, and seeing sample scripts



For seeing additional information on each of the cmdLets, you can use the –Full or –Detailed parameters in Get-Help.





e.g. Get-Help Add-Tape –Detailed



Get-Help Add-Tape –Full





DPM Object Properties (Get-Member or gm)





The DPM cmdlets are logically divided in three groups Protection (Backup), Recovery and Management related (Library & Disk). All the tasks that can be done from the DPM UI in these areas, can be done from the cmdLets in these areas. Infact, the CLI provides additional features than the UI, in some scenarios.





You can get the member properties of any object by pipelining the output to Get-Member :





For example:





$lib = Get-DPMLibrary -DPMServerName “Testing Server Name”



$lib | Get-Member





Will give all the members of $lib (Library object).





PS D:\ > $lib | get-member





TypeName: Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.LibraryMan



agement.Library





Name              MemberType    Definition



----                ----------       ---------



ClearCache       Method            System.Void ClearCache()



Dispose            Method            System.Void Dispose()





We hope this was useful, feel free to add comments as feedback to this post. And in the next version, we can add more tricks!





- Mukul Shekawat , Balaji Hariharan

%3CLINGO-SUB%20id%3D%22lingo-sub-340431%22%20slang%3D%22en-US%22%3EDPM%20CLI%20Tips%20'n%20Tricks%3A%20Powershell%20Basics%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-340431%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20TECHNET%20on%20Jun%2018%2C%202008%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EThe%20scripts%20posted%20in%20this%20blog%20require%20knowledge%20of%20Powershell%20and%20DPM%20cmdlets.%20So%20we%20thought%20we%20would%20present%20some%20tips%20%E2%80%98n%20tricks%20to%20become%20power%20users!%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Introduction%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EThe%20first%20difference%20between%20any%20normal%20Command%20Line%20Interface%20(CLI)%20(typically%2C%20Windows%20cmd.exe%20based%20environment)%20%26amp%3B%20Powershell%20is%20that%2C%20Powershell%20is%20a%20full%20blown%20.Net%20environment%20and%20is%20object%20oriented.%20In%20other%20words%2C%20it%20treats%20all%20input%2Foutput%20parameters%20as%20objects%20and%20when%20you%20pipe%20one%20command%20to%20another%2C%20objects%20flow%20instead%20of%20plain%20text%20as%20in%20old%20shells.%20Similarly%2C%20DPM%20Management%20Shell%20also%20takes%20inputs%20in%20the%20form%20of%20objects%20%E2%80%93%20for%20example%2C%20DPM%2C%20Protection%20Group%2C%20Datasource%2C%20Library%2C%20Tape%2C%20Tape%20Drive%2C%20Disk%20etc.%20are%20all%20.Net%20objects.%20Let%E2%80%99s%20now%20move%20on%20to%20more%20interesting%20stuff.%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Finding%20cmdLets%20(Get-Command%20or%20gcm)%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EFor%20knowing%20all%20the%20cmdLets%20present%20in%20the%20Powershell%20instance%2C%20use%20%3CB%3E%20%3CI%3E%20Get-Command%20%3C%2FI%3E%20%3C%2FB%3E%20%3CI%3E%20(or%20%3CB%3E%20gcm%20%3C%2FB%3E%20in%20short).%20%3C%2FI%3E%20When%20run%2C%20the%20output%20will%20be%20something%20like%20this%3A%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EPS%20D%3A%5C%20%26gt%3B%20Get-command%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECommandType%26nbsp%3B%26nbsp%3B%26nbsp%3BName%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BDefinition%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E-----------%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B----%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B----------%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-Content%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-Content%20%5B-Path%5D%20%3CSTRING%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3C%2FSTRING%3E%3C%2FP%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-DPMDisk%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-DPMDisk%20%5B-DPMDisk%5D%20%3CDISK...%3E%3C%2FDISK...%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-History%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-History%20%5B%5B-InputObject%5D%20...%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-Member%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-Member%20%5B-MemberType%5D%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-PSSnapin%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-PSSnapin%20%5B-Name%5D%20%3CSTRING...%3E%3C%2FSTRING...%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-Tape%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-Tape%20%5B-DPMLibrary%5D%20%3CLIBR...%3E%3C%2FLIBR...%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BClear-Content%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BClear-Content%20%5B-Path%5D%20%3CSTRIN...%3E%3C%2FSTRIN...%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%20Finding%20DPM%20cmdLets%20(Get-DPMCommand)%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ESimilarly%20for%20getting%20all%20the%20cmdLets%20belonging%20to%20only%20DPM%2C%20use%20the%20%3CB%3E%20%3CI%3E%20Get-DPMCommand%20%3C%2FI%3E%20%3C%2FB%3E%20.%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EPS%20D%3A%5C%20%26gt%3B%20Get-DPMCommand%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECommandType%26nbsp%3B%26nbsp%3BName%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BDefinition%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E-----------%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B----%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B----------%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-DPMDisk%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-DPMDisk%20%5B-DPMDisk%5D%20%3CDISK...%3E%3C%2FDISK...%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-Tape%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BAdd-Tape%20%5B-DPMLibrary%5D%20%3CLIBR...%3E%3C%2FLIBR...%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BConnect-DPMServer%26nbsp%3B%26nbsp%3B%26nbsp%3BConnect-DPMServer%20%5B-DPMServe...%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BDisable-DPMLibrary%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BDisable-DPMLibrary%20%5B-DPMLibr...%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECmdlet%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BDisable-TapeDrive%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BDisable-TapeDrive%20%5B-TapeDriv...%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%20How%20to%20use%20a%20cmdlet%3F%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%201.%20Understanding%20the%20cmdlet%20parameters%20(Get-Command%20and%20Format-List)%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EThere%20are%20two%20parts%20to%20understanding%20a%20cmdlet.%20First%2C%20to%20look%20at%20the%20various%20input%20parameters%20and%20various%20usages%2C%20you%20can%20use%20the%20Get-Command%20itself%20on%20a%20specific%20cmdlet%2C%20in%20the%20following%20fashion%20%E2%80%93%20%3CB%3E%20%3CI%3E%20Get-Command%20%3CCMDLET%3E%20%7C%20format-list%20%3C%2FCMDLET%3E%3C%2FI%3E%20%3C%2FB%3E%20(or%20%3CB%3E%20%3CI%3E%20gcm%20%3CCMDLET%3E%20%7C%20fl%20%3C%2FCMDLET%3E%3C%2FI%3E%20%3C%2FB%3E%20%2C%20in%20short).%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EPS%20C%3A%5C%26gt%3B%20gcm%20Set-Alias%20%7C%20fl%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EName%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20Set-Alias%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ECommandType%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20Cmdlet%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EDefinition%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20Set-Alias%20%5B-Name%5D%20%3CSTRING%3E%20%5B-Value%5D%20%3CSTRING%3E%20%5B-Description%20%3CSTRING%3E%5D%20%5B-Option%20%3CSCOPEDITEMOPTIONS%3E%5D%20%5B-PassThru%5D%20%5B-Scope%20%3CSTRING%3E%5D%20%5B-Force%5D%20%5B-Verbose%5D%20%5B-Debug%5D%20%5B-ErrorAction%20%3CACTIONPREFERENCE%3E%5D%20%5B-ErrorVariable%20%3CSTRING%3E%5D%20%5B-OutVariable%20%3CSTRING%3E%5D%20%5B-OutBuffer%20%3CINT32%3E%5D%20%5B-WhatIf%5D%20%5B-Confirm%5D%3C%2FINT32%3E%3C%2FSTRING%3E%3C%2FSTRING%3E%3C%2FACTIONPREFERENCE%3E%3C%2FSTRING%3E%3C%2FSCOPEDITEMOPTIONS%3E%3C%2FSTRING%3E%3C%2FSTRING%3E%3C%2FSTRING%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%202.%20Reading%20Help%20documentation%20for%20a%20cmdlet%20(Get-Help%20or%20help)%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EFor%20reading%20the%20Help%20documentation%20for%20any%20cmdlet%20use%20the%20following%20(%20%3CB%3E%20%3CI%3E%20Get-Help%20%3C%2FI%3E%20%3C%2FB%3E%20or%20%3CB%3E%20%3CI%3E%20help%20%3C%2FI%3E%20%3C%2FB%3E%20)%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EGet-Help%20%3CCMDLET%3E%3C%2FCMDLET%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EFor%20example%3A%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EPS%20D%3A%5C%20%26gt%3B%20Get-Help%20Add-Tape%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ENAME%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EAdd-Tape%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ESYNOPSIS%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EAdds%20a%20tape%20to%20a%20DPM%20library.%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ESYNTAX%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EAdd-Tape%20%5B-DPMLibrary%5D%20%3CLIBRARY%3E%20%5B-Async%5D%20%5B-JobStateChangedEventHandler%20%3CJO%3E%3C%2FJO%3E%3C%2FLIBRARY%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EbStateChangedEventHandler%26gt%3B%5D%20%5B%3CCOMMONPARAMETERS%3E%5D%3C%2FCOMMONPARAMETERS%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%E2%80%A6..%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%203.%20Getting%20detailed%20help%2C%20and%20seeing%20sample%20scripts%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EFor%20seeing%20additional%20information%20on%20each%20of%20the%20cmdLets%2C%20you%20can%20use%20the%20%3CI%3E%20%E2%80%93Full%20%3C%2FI%3E%20or%20%3CI%3E%20%E2%80%93Detailed%20%3C%2FI%3E%20parameters%20in%20Get-Help.%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3Ee.g.%20%3CI%3E%20Get-Help%20Add-Tape%20%E2%80%93Detailed%3C%2FI%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CI%3E%20Get-Help%20Add-Tape%20%E2%80%93Full%20%3C%2FI%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CI%3E%20%3C%2FI%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3CB%3E%20DPM%20Object%20Properties%20(Get-Member%20or%20gm)%20%3C%2FB%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EThe%20DPM%20cmdlets%20are%20logically%20divided%20in%20three%20groups%20Protection%20(Backup)%2C%20Recovery%20and%20Management%20related%20(Library%20%26amp%3B%20Disk).%20All%20the%20tasks%20that%20can%20be%20done%20from%20the%20DPM%20UI%20in%20these%20areas%2C%20can%20be%20done%20from%20the%20cmdLets%20in%20these%20areas.%20Infact%2C%20the%20CLI%20provides%20additional%20features%20than%20the%20UI%2C%20in%20some%20scenarios.%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EYou%20can%20get%20the%20member%20properties%20of%20any%20object%20by%20pipelining%20the%20output%20to%20%3CB%3E%20Get-Member%20%3C%2FB%3E%20%3A%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EFor%20example%3A%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%24lib%20%3D%20Get-DPMLibrary%20-DPMServerName%20%E2%80%9CTesting%20Server%20Name%E2%80%9D%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%24lib%20%7C%20Get-Member%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EWill%20give%20all%20the%20members%20of%20%24lib%20(Library%20object).%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EPS%20D%3A%5C%20%26gt%3B%20%24lib%20%7C%20get-member%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3ETypeName%3A%20Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.LibraryMan%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3Eagement.Library%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EName%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BMemberType%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BDefinition%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E----%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B----------%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B---------%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EClearCache%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BMethod%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BSystem.Void%20ClearCache()%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EDispose%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BMethod%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BSystem.Void%20Dispose()%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3EWe%20hope%20this%20was%20useful%2C%20feel%20free%20to%20add%20comments%20as%20feedback%20to%20this%20post.%20And%20in%20the%20next%20version%2C%20we%20can%20add%20more%20tricks!%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E-%20%3CA%20href%3D%22http%3A%2F%2Fblogs.technet.com%2Fdpm%2Fpages%2Fmukul-singh-shekhawat-s-bio.aspx%22%20mce_href%3D%22http%3A%2F%2Fblogs.technet.com%2Fdpm%2Fpages%2Fmukul-singh-shekhawat-s-bio.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20Mukul%20Shekawat%20%3C%2FA%3E%20%2C%20%3CA%20href%3D%22http%3A%2F%2Fblogs.technet.com%2Fdpm%2Fpages%2F416005.aspx%22%20mce_href%3D%22http%3A%2F%2Fblogs.technet.com%2Fdpm%2Fpages%2F416005.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20Balaji%20Hariharan%20%3C%2FA%3E%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-340431%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TECHNET%20on%20Jun%2018%2C%202008%20The%20scripts%20posted%20in%20this%20blog%20require%20knowledge%20of%20Powershell%20and%20DPM%20cmdlets.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-340431%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESystem%20Center%20Data%20Protection%20Manager%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Mar 11 2019 08:03 AM
Updated by: