none
Queries across multiple DPM servers RRS feed

  • Question

  • Hi!

     

    I am trying to get a report that will list the newest recovery points across 5 DPM servers. Is there any way to create a script that will pull all the desired info? I was thinking along these lines: (Get-ProtectionGroup -DPMServer nbgdpm01 | foreach {Get-Datasource $_}) | Sort-Object ProtectionGroup, ProductionServerName, but to somehow include all my dpm servers in this. Any examples would be appreciated.

    Thanks!

    Steve

    Thursday, June 2, 2011 8:59 PM

Answers

  • Hi Steve,

     

    Yes, just replace the first line from:

    $DPM = read-host "Enter all DPM Server you want to retrieve the list";

    to

    $DPM = "<server1> <server2> <server3> ...";

     


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights
    Tuesday, June 7, 2011 4:32 PM
    Moderator

All replies

  • Hi casadedolor,

    The sample you provided only lists the datasources being protected by a single DPM. It doesn't provide anything related to newest/latest recovery point.

    Do you want want this same script to be able to connect to remote SQL and retrieve their datasource list as well?

    It was my understand that what you want as output is a datasource along with its newest recovery point and the script should be able to connect to others DPM servers and retrieve the same kind information.


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights
    Saturday, June 4, 2011 12:21 AM
    Moderator
  • Hi Wilson,

    That is exactly right for how I want my script. I know that the command only pulls from one server. Basically, I need a script that will query all 5 DPM servers and output it to a single file. Sorry if my original request was not clear. :)

     

    Thanks!

    Steve

    Monday, June 6, 2011 3:21 PM
  • Hi Steve,

     

    Try this:

    $DPM = read-host "Enter all DPM Server you want to retrieve the list";

    $dpm = @($dpm -split " ");
    foreach ($dpm1 in $dpm)
    {
       disconnect-dpmserver;
       (Get-ProtectionGroup -DPMServer $dpm1 | foreach {Get-Datasource $_} | Sort-Object ProtectionGroup, ProductionServerName);
    }

     

    Note: When entering the DPM Server names, use a single space between them. The script assumes that you do have permissions to connect to remote DPM servers (you can test by running connect-dpmserver <servername>)


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights
    Tuesday, June 7, 2011 5:44 AM
    Moderator
  • That works great Wilson! Is there any way I can just have the servers entered statically so I don't have to enter them each time?

     

    Thanks!

     

    Steve

    Tuesday, June 7, 2011 3:13 PM
  • Hi Steve,

     

    Yes, just replace the first line from:

    $DPM = read-host "Enter all DPM Server you want to retrieve the list";

    to

    $DPM = "<server1> <server2> <server3> ...";

     


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights
    Tuesday, June 7, 2011 4:32 PM
    Moderator
  • Hi Wilson,

     

    Thanks for all your help so far with this. I have my script like this:

     

    $DPM = "testdpm01 testdpm02";

    $dpm = @($dpm -split " ");
    foreach ($dpm1 in $dpm)
    {
       disconnect-dpmserver;
       (Get-ProtectionGroup -DPMServer $dpm1 | foreach {Get-Datasource $_} | Sort-Object ProtectionGroup, ProductionServerName);
    }

     and it gives me this error:

    Get-ProtectionGroup : Cannot validate argument on parameter 'DPMServerName'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.

    Any idea what I am doing wrong?

    Thanks!

    Steve

    Tuesday, June 7, 2011 6:40 PM
  • This will happen if $dpm is coming back empty.

    Just run this way to check the value of $DPM.

    $DPM = "testdpm01 testdpm02";

    $dpm = @($dpm -split " ");

    $dpm
    foreach ($dpm1 in $dpm)
    {
    disconnect-dpmserver;
    (Get-ProtectionGroup -DPMServer $dpm1 | foreach {Get-Datasource $_} | Sort-Object ProtectionGroup, ProductionServerName);
    }

    Before the error, you should see these lines:

    testdpm01

    testdpm02

     

     


    Thanks, Wilson Souza - MSFT This posting is provided "AS IS" with no warranties, and confers no rights
    Tuesday, June 7, 2011 7:31 PM
    Moderator