Quantcast
Channel: THWACK: Document List - Network Performance Monitor
Viewing all articles
Browse latest Browse all 1956

Disable Accounts that have not been used in 12 Months

$
0
0

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:

 

UPDATE Accounts

SET AccountEnabled = 'N'

WHERE

  (

  dbo.Accounts.LastLogin <= dateadd(

  m,

  datediff(m, 0, CURRENT_TIMESTAMP) -12,

  0

  )

  OR dbo.Accounts.LastLogin >= dateadd(

  m,

  datediff(m, 0, CURRENT_TIMESTAMP)+ 1,

  0

  )

  )

AND AllowAdmin = 'N'

AND AccountType != 4

AND AccountEnabled != 'N';


Viewing all articles
Browse latest Browse all 1956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>