Link to home
Start Free TrialLog in
Avatar of brian_leighty
brian_leighty

asked on

Is it possible to Enumerate through Site Collections using only the Sharepoint Client Object Model?

I have approximately 15 thousand site collections and I would like to return a list of all of these site collections using only the Sharepoint Client Object Model.  I'm wanting to create a listview or dropdown list to display these site collections.  I'm using c# to accomplish this task.

Thanks
Brian
Avatar of fabianbaptista
fabianbaptista

Using dropdown is not a good idea to show 15.000 elements.

to retrieve the site list, see
http://msdn.microsoft.com/en-us/library/ee538971.aspx

regards
Avatar of brian_leighty

ASKER

Having a problem getting the first Include for the list collection.

Intellisense:
'Microsoft.SharePoint.Client.ListCollection' does not contain a definition for 'Include' and no extension method 'Include' accepting a first argument of type 'Microsoft.SharePoint.Client.ListCollection' could be found (are you missing a using directive or an assembly reference?)


listInfo = clientContext.LoadQuery(
                collList.Include(                  <---------------------This include
                    list=>list.Title,
                    list=>list.Fields.Include(
                        field=>field.Title).Where(
                        field=>field.Required  == true
                        && field.Hidden != true)));


Does this being a Silverlight control and not a winapp effect this?
ASKER CERTIFIED SOLUTION
Avatar of fabianbaptista
fabianbaptista

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Daryl Sirota
What's wrong with calling stsadm.exe -o enumsites -url <the root http url> ?
I'm building a Office add-in based off of some Windows Forms in c#.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I actually just used the dropdown as a concept of what I'm trying to architect.  If I used a list or dropdown it woul dbe lazyloaded or autocompleted from a search.  This is for a document management system purely fo rredirection of users to site collections.  I also have to use the Client Object Model to create this list.   Any thoughts....