SQL does not exist when processing Protection Group RRS feed

  • Question

  • I'm trying to run the script from here in a scheduled task against DPM 2012 R2

    It fails at some point in this section when it gets to the SQL server in the protection group.

    # 6. Scan through the obtained list of protected servers
    foreach ($PS in $PSList)
        write-host "Processing " $PS

        # 6.1 Search for the protected server name passed as input
        if($PS.Name -eq $ProductionServer)
            write-host "Running Inquiry on" $PS.Name

            # 6.1.1 Run inquiry on the protected server matched
            $DSlist += Get-Datasource -ProductionServer $PS -Inquire

        "Production Server $PS does not exist"
        exit 1

    The error is:
    Production Server <SQL server FQDN> does not exist.

    Has anyone else seen this? What part of the above code may be causing the issue?
    Thursday, August 21, 2014 9:41 AM

All replies

  • For anyone having the same problem I got around it by adding:

     -ErrorAction silentlycontinue

    to the end of the line starting '$DSlist'.

    I also put a break statement after $PSFound=$true and put the contents of the if statement in a try/catch as it will throw an exception if it can't enumerate the contents of certain objects on the server.

    Thursday, September 11, 2014 2:04 PM