cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 9

No user logons to a Windows Server for 60 days

Hi,

Can someone please help me with a script to check if no user has logged on to a windows server within 60 days please? There currently isn't an alert capable of doing this, so a PowerShell script will have to be used. Would I be able to run this script as part of the application template and then apply to an alert?

I have contacted SolarWinds SUpport who told me that this is being possibly looked at as a feature addition for the future.

Thanks,

Terry 

N.B. If this is the wrong discussion board, please can someone let me know what the best place would be?

0 Kudos
2 Replies

Yeah, you would just need to set up the powershell with the correct format. From some quick googling you could get the max timestamp from something like this https://4sysops.com/archives/use-powershell-to-get-last-logon-information/ and just set it up so that if the timestamp is < 60 days ago you give a statistic: 1 else statistic:0

I've always found this to be the most helpful threads on learning how the powershell component should work, https://thwack.solarwinds.com/t5/Geek-Speak-Blogs/The-Basics-of-PowerShell-part-3/ba-p/434046
- Marc Netterfield, Github

Thanks - 

I had started googling myself and have come across this: https://www.oxfordsbsguy.com/2014/04/28/powershell-get-adcomputer-to-retrieve-computer-last-logon-da...

Will take a look at your suggestions and keep that in mind for the future. Glad my thought process was on the right track..

Terry

0 Kudos