Extract agent info from the clone object

Roll out is going well. I am now looking to ways to effectively cycle images. We agreed with a dev team on a predictable refresh schedule.

I'm trying to get the MachineName and Environement from the clone object using the commandlet. I can't get to figure out the best way to go. I find no hang from the clone object to its sql clone env.

The reason being : After dropping all old images (and their clones), I need to re-create new clones with a newer DB image. Ideally, the process would be fully automated and transparent to the dev teams.

Thanks in advanced for your help
Regard
David
Tagged:

Best Answer

  • ErdoganOzkocaErdoganOzkoca Posts: 7 Bronze 2
    Accepted Answer
    Hi Benethor,

    You can use the below script to get the machine name and environment from a clone.

    Connect-SqlClone -ServerUrl 'http://your_sql_clone_domain:14145'
    $clone = Get-SqlClone -Name your_clone_name
    $locationId = $clone.LocationId
    $sqlServerInstance = Get-SqlCloneSqlServerInstance | where {$_.Id -eq $clone.LocationId}
    $sqlServerInstance.Machine

Answers

Sign In or Register to comment.