Ask a questionAsk a question
 

AnswerSQL Query Required to get the Users on a Site

  • Tuesday, November 03, 2009 5:32 AMJain Deepika Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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

Answers

  • Wednesday, November 04, 2009 7:07 AMGuYumingMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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.

All Replies

  • Wednesday, November 04, 2009 7:07 AMGuYumingMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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.