locked
List of all users and the user profile RRS feed

  • Question

  • Hi,

    I was wondering if there is a way to create a list that will always display a list of all the users in the company with profiles in SharePoint?

    I am planning to have such list in the IT Site where we can add attribute such as Induction Training, Outlook Training, etc... to keep records of all their training activities.

    Wednesday, October 5, 2011 2:13 AM

Answers

  • There is a hidden list at http://site-collection/_catalogs/users/ (User Information List). You can create a new list and add a lookup to this list. You should not modify the user info list as it is supposed to sync with user profile service.
    AK
    Wednesday, October 5, 2011 6:46 AM
  • Hi,

    You  have to retrieve all user profiles in your site collection .
    And  retrieve profile information from USer Information List . This list is in site collection,
     makes it faster to retrive user .


    Reference :http://www.zimmergren.net/archive/2008/06/25/sharepoints-hidden-user-list-user-information-list.aspx

    and you can also check the below code as well
    Also try the following

    StringBuilder queryText = new StringBuilder();
    queryText.Append("SELECT PreferredName, Department, AccountName ");
    queryText.Append("FROM SCOPE() ");
    queryText.Append("WHERE \"scope\" = 'People' ");
    // add a "AND fieldname = 'vaue'" to the querytext

    Microsoft.Office.Server.Search.Query.FullTextSqlQuery query = new Microsoft.Office.Server.Search.Query.FullTextSqlQuery(SPContext.Current.Site);
    query.QueryText = queryText.ToString();
    query.ResultTypes = Microsoft.Office.Server.Search.Query.ResultType.RelevantResults;
    query.RowLimit = 5000;

    Microsoft.Office.Server.Search.Query.ResultTableCollection results = query.Execute();

    WhenCreated wasn't a field that existed out of the box.

    Hope this helps

     


    Krishana Kumar http://mosstechnet-kk.com
    Wednesday, October 5, 2011 6:59 AM

All replies

  • There is a hidden list at http://site-collection/_catalogs/users/ (User Information List). You can create a new list and add a lookup to this list. You should not modify the user info list as it is supposed to sync with user profile service.
    AK
    Wednesday, October 5, 2011 6:46 AM
  • Hi,

    You  have to retrieve all user profiles in your site collection .
    And  retrieve profile information from USer Information List . This list is in site collection,
     makes it faster to retrive user .


    Reference :http://www.zimmergren.net/archive/2008/06/25/sharepoints-hidden-user-list-user-information-list.aspx

    and you can also check the below code as well
    Also try the following

    StringBuilder queryText = new StringBuilder();
    queryText.Append("SELECT PreferredName, Department, AccountName ");
    queryText.Append("FROM SCOPE() ");
    queryText.Append("WHERE \"scope\" = 'People' ");
    // add a "AND fieldname = 'vaue'" to the querytext

    Microsoft.Office.Server.Search.Query.FullTextSqlQuery query = new Microsoft.Office.Server.Search.Query.FullTextSqlQuery(SPContext.Current.Site);
    query.QueryText = queryText.ToString();
    query.ResultTypes = Microsoft.Office.Server.Search.Query.ResultType.RelevantResults;
    query.RowLimit = 5000;

    Microsoft.Office.Server.Search.Query.ResultTableCollection results = query.Execute();

    WhenCreated wasn't a field that existed out of the box.

    Hope this helps

     


    Krishana Kumar http://mosstechnet-kk.com
    Wednesday, October 5, 2011 6:59 AM