.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Squadron Documentation : A SharePoint tool

Posted By:Jean Paul       Posted Date: September 29, 2014    Points: 200    Category: SharePoint    URL: http://www.dotnetspark.com  

In this article we can explore Documentation add-in of Squadron.
 

Documentation helps with documenting the SharePoint Farm & Application information.

image

Who is the Target Audience?

This tool is targeted for Architects, Administrators & Developers.

A SharePoint Professional can use the tool to capture information about the Customer SharePoint Farm. You need to run this in the SharePoint Farm Server.

How to run the Documentation add-in?

Open Squadron > Choose Documentation from the left panel > Select required items > Click Execute button. You will get the results as shown below.

clip_image002

HTML Export

The tool provides HTML export of the results.

clip_image003

After fetching the results, you can click this button to create the HTML report.

clip_image005

clip_image007

clip_image009

clip_image011

After report generation, you can actually save the HTML file using browser. By default the User's Documents folder is the location of generated file.

Code Behind

For those who are curious to know the code behind, please find the same here.

Farm Servers code:

 

private void Refresh_FarmServers()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        foreach (SPSolution s in SPFarm.Local.Solutions)
            list.Add(new SPFarmSolutionEntity(s));
    });
}

Services code:

 

 

private void Refresh_Services()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        foreach (SPService s in SPFarm.Local.Services)
            list.Add(new SPServiceEntity(s));
    });
}

Service Applications code:

 

private void Refresh_ServiceApplications()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        foreach (SPService s in SPFarm.Local.Services)
            foreach (SPServiceApplication sa in s.Applications)
                list.Add(new SPServiceApplicationEntity(sa));
    });
}

Content Databases code:

 

private void Refresh_ContentDatabases()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPServiceCollection services = SPFarm.Local.Services;
                
        foreach (SPService service in services)
        {
            if (service is SPWebService)
            {
                SPWebService webservice = (SPWebService)service;

                foreach (SPWebApplication webapp in webservice.WebApplications)
                    foreach (SPContentDatabase cd in webapp.ContentDatabases)
                        list.Add(new SPContentDatabaseEntity(cd));
            }
        }
    });
}

Farm Solutions code:

 

private void Refresh_FarmSolutions()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        foreach (SPSolution s in SPFarm.Local.Solutions)
            list.Add(new SPFarmSolutionEntity(s));
    });
}

User Solutions code:

 

private void Refresh_UserSolutions()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPServiceCollection services = SPFarm.Local.Services;

        foreach (SPService service in services)
        {
            if (service is SPWebService)
            {
                SPWebService webservice = (SPWebService)service;

                foreach (SPWebApplication webapp in webservice.WebApplications)
                    foreach (SPSite sitec in webapp.Sites)
                        foreach (SPUserSolution s in sitec.Solutions)
                            list.Add(new SPUserSolutionEntity(s) };
            }
        }

    });
}

Managed Paths code:

 

private void Refresh_ManagedPaths()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPServiceCollection services = SPFarm.Local.Services;

        foreach (SPService service in services)
        {
            if (service is SPWebService)
            {
                SPWebService webservice = (SPWebService)service;

                foreach (SPWebApplication webapp in webservice.WebApplications)
                    foreach (SPPrefix p in webapp.Prefixes)
                        list.Add(new SPManagedPathEntity(p) });
            }
        }

    });
}

Web Applications code:

 

private void Refresh_WebApplications()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPServiceCollection services = SPFarm.Local.Services;

        foreach (SPService service in services)
        {
            if (service is SPWebService)
            {
                SPWebService webservice = (SPWebService)service;

                foreach (SPWebApplication webapp in webservice.WebApplications)
                    list.Add(new SPWebApplicationEntity(webapp));
            }
        }
    });
}

Site Collections code:

 

private void Refresh_SiteCollections()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPServiceCollection services = SPFarm.Local.Services;

        foreach (SPService service in services)
        {
            if (service is SPWebService)
            {
                SPWebService webservice = (SPWebService)service;

                foreach (SPWebApplication webapp in webservice.WebApplications)
                {
                    foreach (SPSite sitec in webapp.Sites) 
                        list.Add(new SPSiteEntity(sitec));
                }
            }
        }
    });
}

Sites code:

 

private void Refresh_Sites()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPServiceCollection services = SPFarm.Local.Services;

        foreach (SPService service in services)
        {
            if (service is SPWebService)
            {
                SPWebService webservice = (SPWebService)service;

                foreach (SPWebApplication webapp in webservice.WebApplications)
                    foreach (SPSite sitec in webapp.Sites)
                    {
                        foreach (SPWeb web in sitec.AllWebs)
                            list.Add(new SPWebEntity(web)); 
                    }
            }
        }
    });
}

Lists code:

 

private void Refresh_Lists()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPServiceCollection services = SPFarm.Local.Services;

        foreach (SPService service in services)
        {
            if (service is SPWebService)
            {
                SPWebService webservice = (SPWebService)service;

                foreach (SPWebApplication webapp in webservice.WebApplications)
                    foreach (SPSite sitec in webapp.Sites)
                        foreach (SPWeb web in sitec.AllWebs)
                        {
                            foreach (SPList l in web.Lists)
                                list.Add(new SPListEntity(l));
                        }
            }
        }
    });
}

Items code:

 

private void Refresh_Items()
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        SPServiceCollection services = SPFarm.Local.Services;

        foreach (SPService service in services)
        {
            if (service is SPWebService)
            {
                SPWebService webservice = (SPWebService)service;

                foreach (SPWebApplication webapp in webservice.WebApplications)
                    foreach (SPSite sitec in webapp.Sites)
                        foreach (SPWeb web in sitec.AllWebs)
                            foreach (SPList l in web.Lists)
                            {
                                foreach (SPListItem item in l.Items)
                                    list.Add(new SPItemEntity(item));
                            }
            }
        }
    });
}

clip_image013

The information fetch is purely Read-Only using Server Object Model. There are no-write operations for this add-in.

clip_image015

If you wanted some more items or fields to be included in the Documentation, please let me know, I am happy to provide it. (I am even ready to create the SharePoint 2013 version of tool on demand)

About Items

The last item 'Items' will be fetching List items / Library documents information. This will be very-time consuming depending on the size of farm. By default it is kept unselected.

What is Squadron?

Squadron is a Free SharePoint Administration tool available at www.sharepointcto.com.

clip_image016

How to download Squadron?

Squadron for SharePoint 2010 can be downloaded from link below:

http://www.sharepointcto.com/Squadron/Default.aspx

Squadron is built on Click Once deployment, so installation is simple & automatic updates are possible.

clip_image017

References

http://www.sharepointcto.com/Squadron/Default.aspx

Summary

In this article we have explored Documentation Addin of Squadron. I hope this will be helpful for you in real world scenarios.v


 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend