Skip to content

Instantly share code, notes, and snippets.

@akanieski
Last active November 30, 2020 16:30
Show Gist options
  • Save akanieski/eecf19f1e05af7c6c732898cbf51da5a to your computer and use it in GitHub Desktop.
Save akanieski/eecf19f1e05af7c6c732898cbf51da5a to your computer and use it in GitHub Desktop.
Get an inventory of SSH Keys used by Azure DevOps Server users.
use [Tfs_Configuration]
SELECT
id.DisplayName as 'KeyOwner',
access_key.DisplayName as 'KeyName',
meta.ValidFrom as 'CreatedAt',
meta.ValidTo as 'ExpiresAt'
FROM dbo.tbl_DelegatedAuthorizationAccessKey as access_key
left join dbo.tbl_Identity id on id.Id = access_key.IdentityId
left join dbo.tbl_DelegatedAuthorizationAccess meta on meta.AccessId = access_key.AccessId
WHERE
meta.IsValid = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment