SQL Query Required to get the Users on a Site
- Hi ,
I need a SQL Query which can query upon the sharepoint database to get the users added in a site collection or site after a particular date only.
Thanks,
Deepika- Moved byMike Walsh MVPMVP, ModeratorTuesday, November 03, 2009 7:02 AMNot BDC. (From:SharePoint - Business Data Catalog)
Answers
Direct interaction with SharePoint database is not supported.
As a workaround to your request, you can display the user information list (hidden by default) on a page in a Data Form Web Part with the help of SharePoint Designer:
1. Open the site in SharePoint Designer (SPD);
2. Expand the _catalogs folder in SPD folder list;
3. Right click the Users(User Information List) and open the properties dialog for the list;
4. Click settings tab for the list properties dialog, uncheck the Hide from browsers checkbox;
5. Create a new ASPX page in SPD, and insert a Data View (data form web part) onto this page, select the User Information List as the data source of this Data Form Web Part, and select the fields you want to display.
6. Save the page into a document library, then open it from the document library in web browser, you would see all the users in the site collections;
7. You can modify the Data Form Web Part created in step 5, set the filter so that it returns only those users created after a particular date.
Please refer to http://msdn.microsoft.com/en-us/library/cc300163.aspx for detail about using DFWP in SPD.
- Marked As Answer byGuYumingMSFT, ModeratorMonday, November 09, 2009 9:31 AM
All Replies
Direct interaction with SharePoint database is not supported.
As a workaround to your request, you can display the user information list (hidden by default) on a page in a Data Form Web Part with the help of SharePoint Designer:
1. Open the site in SharePoint Designer (SPD);
2. Expand the _catalogs folder in SPD folder list;
3. Right click the Users(User Information List) and open the properties dialog for the list;
4. Click settings tab for the list properties dialog, uncheck the Hide from browsers checkbox;
5. Create a new ASPX page in SPD, and insert a Data View (data form web part) onto this page, select the User Information List as the data source of this Data Form Web Part, and select the fields you want to display.
6. Save the page into a document library, then open it from the document library in web browser, you would see all the users in the site collections;
7. You can modify the Data Form Web Part created in step 5, set the filter so that it returns only those users created after a particular date.
Please refer to http://msdn.microsoft.com/en-us/library/cc300163.aspx for detail about using DFWP in SPD.
- Marked As Answer byGuYumingMSFT, ModeratorMonday, November 09, 2009 9:31 AM

