none
Get-DPMProductionServer -DPMServerName $dpmname | where { $_.servername -like "$dpmname" }" RRS feed

  • Question

  • Hi guys,

    my DPM PS Script does not work,

    "$dpmdbps = Get-DPMProductionServer -DPMServerName $dpmname | where { $_.servername -like "$dpmname" }"

    returns a NULL Object although $dpmname is set correctly .. any idea?!

    Thanks in advance,

    Markus

    $dpmname = "ws000212.abc.com" $pgname = "" $User = “$env:USERDOMAIN\$env:USERNAME” $hypervclustername = "abc001003" $Credentials = get-credential $User Disconnect-DPMServer #Define PG Name $dpmdbpgname = "PG-$location-ABC_000" # Next seems to return NULL Object ... without where clause it returns all agents perfectly $dpmdbps = Get-DPMProductionServer -DPMServerName $dpmname | where { $_.servername -like "$dpmname" } $dpmdbds = Get-Datasource -ProductionServer $dpmdbps -Inquire | where { $_.objecttype -like "SQL*" }


    Wednesday, February 28, 2018 7:23 PM

Answers

  • housekeeping - closing old post.

    The below works as is, just put in a valid netbiosname for a protected server.

     $dpmdbps = Get-DPMProductionServer -DPMServerName (&hostname) | where { $_.servername -like "netbiosname" }


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, January 6, 2020 10:24 PM
    Moderator