Thursday, February 17, 2011

Certificates To Say Thanks

Command T-SQL query to locate users in SharePoint supplanted when removed Active Directory

What happens is that SharePoint (/ 2007, 2010) does not delete the user history, and important for obvious reasons. But he has no control over as given in the Active Directory user accounts and if an IT manager comes up remove a user from AD and use your signature will show again in SharePoint user information old, and give the effect of impersonation. As

place if indeed this happened. Follow the following steps:

1. Place the content database that the Web application where is the portal through SharePoint Central Administration (I leave for work).

2. Then will the Management Studio where server is located where is installed SQL Server databases in SharePoint.

3. Select the portal database.

4. Run the following "query" select

   
tp_Login
, tp_title
, tp_email
, tp_externaltokenlastupdated
from
dbo.UserInfo
WHERE tp_Login like '% value to search%'



this will show that this supplanting the other, you can search the username tp_title use the column.


do not recommend that you delete the user directory database, but through the SharePoint Object Model. Segment


code using the SharePoint OM is as follows:


 
SPUser SPUser = spWeb.SiteUsers [loginName]
if (! spUser.IsDomainGroup & &
!
spUser.IsSiteAdmin & &! loginName.Equals ( @ "NT AUTHORITY \\ authenticated users") & &
! loginName.Equals (@ "NT AUTHORITY \\ LOCAL SERVICE") & &
! loginName.Equals (@ "SHAREPOINT \\ system")) {
SPWeb
. SiteUsers.Remove (spUser.LoginName)
spWeb.Update ();}





If you enter the code find a free online tool possibly be found.


SharePoint4Fun, Manolo Herrera


0 comments:

Post a Comment