Thursday, September 17, 2009

Working with User in Sitecore

Today is the second time I've been looking for the User template because I needed to add a field. This will probably happen again, but next time I have this blog post (HA!):

The User template is located in the Core database at /sitecore/templates/System/Security/User.

If you then need to get a list of all users in the database, run

var userProvider = new UserProvider();
foreach (User user in userProvider.GetUsers())
{
// Do something with user...
}


*NB:* This is based on Sitecore 6.