get-policyschedule syntax question RRS feed

  • Question

  • I'm trying to get details on my protection group (mainly synchronization time). The recommended command is:

    get-policyschedule -protectiongroup <groupname>

    Every attempt returns the following:


    Get-PolicySchedule : Cannot bind parameter 'ProtectionGroup'. Cannot convert the "TestGroup" value of type "System.String" to type "Microsoft.Internal.EnterpriseStorage.Dls.UI.ObjectModel.OMCommon.ProtectionGroup".
    At line:1 char:19 + get-policyschedule <<<<  -shortterm + CategoryInfo          : InvalidArgument: (:) [Get-PolicySchedule], ParameterBindingException
        + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.Interna


    I'm missing something in the syntax and I can't figure it out.

    Josh Ailes, IT Operations Manager


    IT Operations Manager
    Thursday, March 17, 2011 8:29 PM


  • There are two issues.  First, your syntax is not correct. You need to specify "-LongTerm" or "-ShortTerm" or "-OffsetSchedule".  In addition you are passing a string (the name of the group).  Almost all DPM cmdlets require actual objects.  You must do the lookup yourself.  So you need to get the protection group into a variable like this:

      $pg = Get-ProtectionGroup $env:COMPUTERNAME | Where-Object { $_.FriendlyName -eq "TestGroup" }

    Then you can run this command:

      Get-PolicySchedule -ShortTerm $pg

    Hope this helps.

    • Proposed as answer by Marco Shaw Saturday, March 19, 2011 1:00 AM
    • Marked as answer by jailes Wednesday, March 23, 2011 4:10 PM
    Thursday, March 17, 2011 9:44 PM