1

I'm currently working on a Project Management System. Is there a way that I could list all projects which were created as site collections?

https:server/projects/project1
https:server/projects/project2
https:server/projects/project3

I want to show on this link https:server/ something like this:

  • Project 1 - Project 1 Description
  • Project 2 - Project 2 Description
  • Project 3 - Project 3 Description
0

You could use Powershell to get your list of site collections.

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
Get-SPWebApplication http://yourwebapp.com | Get-SPSite | Select ID, Url | Out-File -FilePath "D:\spSites.txt"

Then using the output you could create a list where end users could access it.

0

You can use server object model to get all site collection.

private List<SiteUrl> GetApplicationWebs()
    {
        List<SiteUrl> siteList = new List<SiteUrl>();

        SPWebApplication webApp = GetWebAppCollection(SPContext.Current.Site.Url);
        foreach (SPSite site in webApp.Sites)
        {
            site.CatchAccessDeniedException = false;
            if (site != null)
            {
                using (SPWeb web = site.OpenWeb())
                {
                    siteList.Add(new SiteUrl(web.Title, web.Url, web.Webs.Count));

                }
            }
        }


        return siteList;

    }

Also can refer link

0

Search could also be an option , set the query to "path:https:server/projects/ Contentclass:STS_Site"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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