Skip to content

Instantly share code, notes, and snippets.

@spuder
Created August 5, 2016 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spuder/d5a19a300de81146c4e9474e211a18d9 to your computer and use it in GitHub Desktop.
Save spuder/d5a19a300de81146c4e9474e211a18d9 to your computer and use it in GitHub Desktop.
Check if octopus deploy tentacle is registered with server
# Powershell script to see if an octopus deploy tentacle is registered with an octopus deploy server
# Returns true if node is 'not' registered
# Replace 'http://octopus.example.com' and '1234578910' with your server and octopus deploy api key
Add-Type -Path '.\\Newtonsoft.Json.dll'
Add-Type -Path '.\\Octopus.Client.dll'
$endpoint = new-object Octopus.Client.OctopusServerEndpoint 'http://octopus.example.com', '12345678910'
$repository = new-object Octopus.Client.OctopusRepository $endpoint
$tentacle = New-Object Octopus.Client.Model.MachineResource
$thumbprint = (& '.\\Tentacle.exe' show-thumbprint --nologo --console)
$thumbprint = $thumbprint -replace '.*([A-Z0-9]{40}).*', '$1'
[string]::IsNullOrEmpty($thumbprint) -OR $repository.Machines.FindByThumbprint($thumbprint).Thumbprint -ne $thumbprint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment