none
Sharepoint Users and Activity...

    Question

  • I have been asked to come up with a simple way to gather users in all of the sharepoint sites, and report on the users, which databases(sites) they are in, which user groups they are a part of, and their last login times.

    In lieu of using the Sharepoint API with an unknown number of sites, I decided to tackle it from the database perspective, as all MOSS databases reside on the same SQL instance.  So I have everything in place, I am logging the tp_login, and using the tp_ExternalTokenLastUpdated to get the last login time if there is one, if not, then I just put in a null date of (1/1/1900) to let the site content owners know that user has never logged in.

    My problem is distinguishing between users that are active, and ones that have been deactivated, or deleted.  I have read the topic from MSDN about the UserInfo table 

    http://msdn.microsoft.com/en-us/library/dd303914(v=prot.13).aspx
    and see where is states that tp_IsActive would be set to 0 if the user has been deactivated.  And also about the tp_Deleted which would equal the users tp_Id if the user has been deleted (or at least it wouldn't be 0 anymore).  I guess my question is, is there a difference between IsActive and Deleted ? Would a Deleted user  (having a tp_Deleted of greater than 0) also have a tp_IsActive of 0 ?  I have been finding pretty much every combination of the two.  IsActive is with Deleted equal to 0, IsActive 1 and deleted greater than 0, IsActive 0 and Deleted greater than 0 (expected), and IsActive 1 and Deleted 0 (expected).
    Tuesday, March 06, 2012 4:13 PM

All replies