Skip to content

Instantly share code, notes, and snippets.

@Dalmirog-zz
Created January 21, 2015 18:15
Show Gist options
  • Save Dalmirog-zz/8367e7b8b0711f2f941a to your computer and use it in GitHub Desktop.
Save Dalmirog-zz/8367e7b8b0711f2f941a to your computer and use it in GitHub Desktop.
Gets count of Octopus Users and Tentacles on a specific instance
#make sure this path is correct on your machine
Add-Type -Path "C:\Program Files\Octopus Deploy\Tentacle\Newtonsoft.Json.dll"
Add-Type -Path "C:\Program Files\Octopus Deploy\Tentacle\Octopus.Client.dll"
Add-Type -Path "C:\Program Files\Octopus Deploy\Tentacle\Octopus.Platform.dll"
$OctopusURI = "" #i.e "Http://Octopus.MyAwesomeCompany.com"
$apikey = "" #i.e "API-7CH6XN0HHOU7DDEEUGKUFUR1K"
$endpoint = new-object Octopus.Client.OctopusServerEndpoint "$($OctopusURI)","$($apikey)"
$repository = new-object Octopus.Client.OctopusRepository $endpoint
$machines = $repository.Machines.FindAll()
$Users = $repository.Users.FindAll()
Write-output "Users - $($Users.count)"
write-output "Tentacles - $($machines.count)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment