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: Find Computers Last Logon Date
KB ID 0001612 Problem I had to find the last time a particular server had logged on for a client the other week, so we knew for sure it was dead! Solution The two commands you may need are; Locate Servers Last Login Time Get-ADComputer -Filter {OperatingSystem -Like ‘*SERVER’} -Properties lastlogondate,operatingsystem | Select name,laslogondate,operatingsystem Locate Clients Last Login Time Get-ADComputer -Filter...
Finding Out the Last Time Domain Users have Logged in
KB ID 0000682 Problem Active directory keeps a log of the last time a domain user has authenticated to the domain (from server 2000 onwards) , the drawback with 2000 is that this value didn’t replicate so you had to query each domain controller and cobble the results together. After 2003 this value was replicated (after convergence,) to all domain controllers. Solution Update Here’s a much better way of showing who logged...
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...