What if I'm asked to provide a list with users from active directory that have not logged on for "X" days, for cleaning purposes ?
Hey guys !! How are you doing today ? Today we are going to talk about one very common situation that most of us get quite frequently. How to come up with a list of users that have not logged on for "X" days. From time to time, we should clean stuff up and many times, it is hard to keep AD database clean due to a number of facts that is out of control of the IT department. People leave company, get fired and not all times, IT department get notified in the way it should. You may end up with a bunch of disabled accounts but maybe, not all of them get moved to a disabled OU, or even get deleted when time comes, if company policy allows for account deletion. Powershell can help us to get a comprehensive list of users that have not logged on for whatever number of days make sense in your environment. There are tons of powershell scripts out there that can do this for you but one thing that is very important to understand is that, there are two attributes that can c...