How can I programmatically get a list of all of the Sitecore domains in a site?

1.1k Views Asked by At

In Sitecore 7.5 I would like to be able to get a list of all of the current Sitecore domains in code. I know that Sitecore security is simply built on top of the ASP.NET Membership Provider, but I can't seem to find any documentation on how to get a list of all of the domains in code.

Thanks, Corey

1

There are 1 best solutions below

3
Marek Musielak On BEST ANSWER

There is a GetDomains() method in Sitecore.SecurityModel.DomainManager class:

/// <summary>
/// Gets all domains handled by the current provider.
/// </summary>
public static System.Collections.Generic.IEnumerable<Domain> GetDomains()