Updating Domain Computer Objects with Last Logon and Machine Information
Last Logon KB ID 0001340 Problem I can’t really take the credit for this, I was at a client’s site a few weeks ago, and they were doing this. I thought ‘That’s cool, I’ll have a play with that when I get the chance”. Essentially, you update the description of the Computer object(s) in AD so that they list; The last user who logged on. What time they logged on. What AD ‘Site’ the machine...
PowerShell – List All Domain Users and Their Last Logon Time
KB ID 0000752 Problem In the past I’ve looked at third party tools to do this but what if you wanted to use PowerShell? Solution Heres’ a cool solution that might interest you also Updating Domain Computer Objects with User and Machine Information 1. On your server paste the following script into Notepad; $NumDays = 0 $LogDir = “.Users-Last-Logon.csv” $currentDate = [System.DateTime]::Now $currentDateUtc...