In Email notification include machines the build package is deployed to


First up, I would like to congratulate you on the great product you are building. As a DevOps engineer I’ve looked at several options to automate our build deployments and yours is the one we are most comfortable with.

A question - in the emails we generate post deployment, my manager would like to see if we can also get the machines to which the build package was deployed to. I checked the variable Octopus.Deployment.SpecificMachines, but this one refers to the OD ID of the machines, which doesn’t match the hostname of the machine. We’re looking for something that would quickly help us identify the machines.
I’ve also tried to assign the hostname as a variable in one of the previous PowerShell steps and then use it in the email template, but sadly that doesn’t work either.

Am I missing something or ideas on how to get this implemented are much appreciated.



Thanks for reaching out! Glad to hear Octopus has become your tool of choice :slight_smile:

Unfortunately there’s no current easy way to do this without some scripting. A user outlined a way to do it with an R# script running on the Octopus Server in this post:

There is also a uservoice suggestion to add an out-of-the-box variable for this. If you can drop by and add some votes to it, It’ll be great:

Best regards,

Hi Dalmiro,

thanks for the update.
With regards to your comment on the above thread:

In the meantime, you could use the following snippet which uses the function Get-OctopusMachine from the module Octoposh to resolve the names of the machines based on variable Octopus.Deployment.SpecificMachines

$IDs = $OctopusParameters[‘Octopus.Deployment.SpecificMachines’].split(",")
$names = Get-OctopusMachine -resourceOnly | ?{$ -in $Ids} | select -expandproperty name
You can then use the content of the variable $names to build the string that you’ll pass down to Octo.exe

would this require octoposh be installed on the tentacle machine or on the octopus server?

thanks for the help,
best wishes

Hi Mayank,

That’ll be in the Octopus Server.