Get-CVJob Returning Incorrect Info

Last post 01-05-2021, 7:02 PM by Anthony.Hodges. 3 replies.
Sort Posts: Previous Next
  • Get-CVJob Returning Incorrect Info
    Posted: 12-21-2020, 8:11 AM

    Connecting and Using the Get-CVJob Cmdlet:

    Get-CVJob –ClientName <TestName> -First 5

    I'm trying to build a powershell script that will list info on the last five jobs of *any* server in our environment. I get back the correct info for any server that is in CommVault, but when the server is not in CommVault, I get the following:

    INFO: Get-CVClient: client not found having name [<TestName>]

    An object is also returned containing information about jobs that don't belong to <TestName>.  

    I'm not sure why this is happening.  I guess it is returning output from a sub CmdLet, but I'm not sure how to address it to error out and return nothing, so I can try and catch  and see that the client isn't there.

    Thanks!

  • Re: Get-CVJob Returning Incorrect Info
    Posted: 01-03-2021, 12:08 AM

    I downloaded and installed the Powershell Module from Github just now and for our 11.21.15 enviironment I could get Get-CVJob -ClientName to work.  The -First argument for Get-CVJob is not documented but appears to be included in error at this point.

    To simulate the last five for TestName I took the last week worth of backups and selected the First 5 from the piped output.

    Get-CVJob -ClientName 'TestName' -CompletedTime 168| Select -First 5

  • Re: Get-CVJob Returning Incorrect Info
    Posted: 01-04-2021, 7:32 AM

    Give this a shot:

    Get-CVJob -ClientName 'DoesNotExist' -CompletedTime 168| Select -First 5

    I get output that starts with this:

    INFO: Get-CVClient: client not found having name [DoesNotExist]

     

    Followed by output that has nothing to do with the nonexistent "DoesNotExist" server I queried. 

     

    It should error or not return anything.

     

  • Re: Get-CVJob Returning Incorrect Info
    Posted: 01-05-2021, 7:02 PM

    Ah ok, thanks for clearing that up.  I have raised this as an GitHub Issue.

    https://github.com/Commvault/CVPowershellSDK/issues/19

The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2021 Commvault | All Rights Reserved. | Legal | Privacy Policy