I have a list of service accounts that I'm not familiar with. I'm trying to find out the last time anything has authenticated with this account before I disable or remove it. Is there a way to do this in Active Directory?
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
|
|
The closest you'll get is the "lastLogonTimestamp" on the object. To figure out where it's logging in from, you'll have to parse the Domain Controller Security event-logs to look for the login event and where it came from. |
|||||||||
|
|
With Powershell you can put the list of users in a file called users.txt and try this:
|
|||
|
|
|
And in case you're looking for other ways to query the lastLogonTimeStamp attribute, there is a command line tool called CSVDE (CSV Directory Export) that comes in handy. The following command will output all Active Directory users and their attributes to a CSV file. The command has parameters that also lets you filter and choose specific attributes to export.
|
|||
|
|
