I Created user with custom fields and in User Manger am able to see user custom fields along with data. Are these fields stored in Mongo Db?

I want to retrieve all the custom user profile data into Json format, please suggest any approach.

2 Answers 2


You can use Sitecore PowerShell Extensions to extract the custom properties. The data is stored in the Core database.

Demo in ISE

$user = Get-User -Id "sitecore\michael"
$data = @{}
foreach($name in $user.Profile.GetCustomPropertyNames()) {
    $data[$name] = $user.Profile.GetCustomProperty($name)

$data | ConvertTo-Json

I've not had to do this before but there are a few options available to you by the looks of things.

1) Use an query against the Mongo DB API similar to this:

//Connecting to the Analytics DB
    var driver = Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDriver.FromConnectionString("analytics");

    //Building our query
    var builder = new QueryBuilder();
    var filter = builder.And(builder.GTE(_ => _.StartDateTime, DateTime.Now.AddDays(-30)), builder.EQ(_ => _.SiteName, siteName.ToLower())); 

    //Retrieving data from the "Interactions" collection
    var interactions = driver.Interactions.FindAs(filter)

http://sitecorepro.blogspot.co.uk/2015/06/starting-with-sitecore-analytics.html or http://www.nttdatasitecore.com/Blog/2016/July/Retrieving-Interactions-Data-from-MongoDB-using-Sitecore-Analytics-API

2) Use Sitecore Experience Extractor :https://github.com/Sitecore/experience-extractor

3) It looks like you could also query contact info via Search like so:

using (var context = ContentSearchManager.GetIndex("sitecore_analytics_index").CreateSearchContext())
     var query = context.GetQueryable<IndexedContact>().Where(c=> c.Firstname.Equals("John"));

Can we use xDB contact to do a Lookup for users


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.