We have a large number of accounts in our solarwinds system, a mixture of Ad grous and local accounts. To make sure we keep on top of the accounts we've set all accounts to disabled that haven't been logged into in the last year. To do this we run the following SQL against the DB weekly:
SET AccountEnabled = 'N'
dbo.Accounts.LastLogin <= dateadd(
datediff(m, 0, CURRENT_TIMESTAMP) -12,
OR dbo.Accounts.LastLogin >= dateadd(
datediff(m, 0, CURRENT_TIMESTAMP)+ 1,
AND AllowAdmin = 'N'
AND AccountType != 4
AND AccountEnabled != 'N';