Tuesday, May 24, 2016

Last Login Timestamp

Ok ... here is one that I have used with some of my customers to clean up their user database ...

This script will go through a pool or all the pools in the deployment and check the last login timestamp for all the users that have logged in to each of the member servers (or SBAs).

You can use the -Unique switch to get only the latest login or drop the switch to get all timestamps available in the deployment.

You have also the option of producing the results in a Grid format, or a CSV file. Alternatively, do not specify any output format, and the result will be an array of objects that you can use to pipe into other commands.

If you get an error reading from the SQL database, you might not have access to that server's RTCLocal database; or you may need to open the correct ports (check out the infamous Get-CsConnections.ps1 script by Pat Richard on how to do that).

Hope this helps, and as always your feedback is highly appreciated.

Download
v.0.01 - 2016-05-25 - Get-CsUserLastLogin.v.0.01.zip