Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Archive for April, 2013

Squadron – How to document site hierarchy?

Posted by Paul on April 30, 2013

Based on consultant requests, I have added the following functionality to Squadron.

· Document Site Hierarchy

What is Site Hierarchy?

Site Hierarchy represents the parent-child relationships between sites. A site can have number of sub sites under it. For example a site collection will be having SiteA, then SiteB under SiteA and so.

Site Collection

Site A

Site B

Site C

Let us see how to create such a documentation using Squadron.

clip_image002

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

clip_image004


Step 1: Open Squadron, Explorer

After installing Squadron, execute it from start menu. In the appearing screen enter the URL & choose Explorer add-in from the left.

clip_image006

Step 2: Expand Menu Item

Now right click on the Explorer root node, choose Expand > Up to Site menu item.

clip_image008

This will expand all the nodes up to Site. Please note that there are Site Collection, Site, List & Item types.

clip_image010

Now we need to discard the Library items from the display. We can do it in next step.

Step 3: Hide Menu Item

Right click again & choose the Hide > All Lists option.

clip_image011

This option will hide all the List items from the display.

clip_image012

This completes our Site Hierarchy Documentation. For exploring new SharePoint Installations, the above hierarchical view should be useful.

Note on Refresh

For retrieving the items back, you can use the Refresh menu item. You can even manually expand the nodes to view all children.

clip_image013

clip_image002[1]

Please note that the Menu is Context Sensitive. You can choose the particular node for the behavior.

References

http://www.sharepointcto.com/Squadron

Summary

In this article we have explored the Site Hierarchy Documentation feature of Squadron.

Advertisements

Posted in SharePoint, Uncategorized | Tagged: , , | 2 Comments »

SharePoint Permissions – Part 1 of 3

Posted by Paul on April 29, 2013

In this series article I am trying to reveal the Important Permissions Aspects of SharePoint 2010. Please note that this would be a subset of Security.

clip_image002

Here you can learn the associated Jargons of Permissions.

What is Permission?

Permission is the term used to describe a secured action. Some of the Permissions are:

· View Item

· Open Site

· Read Item

· Delete Item

Why Permissions are needed in SharePoint?

As SharePoint is a sharing & collaborative platform, without permission the usage will lead to inappropriate data, file sharing issues, content manipulations etc.

What are the Permissions Types?

In SharePoint there are 2 types of Permissions:

1. Unique

2. Inherited

The Unique Permission (Custom Permission) is assigned for a particular securable object like site collection. Inherited Permission is the ones inherited from its parent. Inherited Permission is easier to manage, but Unique Permissions gives more granularities in control.

Often the terms Break Permissions &Break Inheritance are also used to define Unique Permissions. This is because we use the Break Permissions button on the particular item to provide unique permissions.

How to set Permissions?

For setting site permissions use the Site Actions > Site Permissions menu item:

clip_image004

For setting list permissions use the List tab > List Permissions button:

clip_image005

For setting item, document, folder permissions use the context menu > Manage Permissions menu item:

clip_image006

What are Permissions Levels?

Permission Levels are group of Permission Items. We can associate Permission Level to a user. Three of the pre-existing & most commonly used Permission Levels are:

1. Full Control

2. Contribute

3. Read

Permission Levels provide easier manageability through grouping of Permissions. We can also create custom permission levels.

What is SharePoint Group?

SharePoint Group is a group of users. Grouping multiple users into single group is the recommended way from Microsoft. By default, SharePoint groups are not nest able. (In contradiction to Active Directory groups which are nest able)

Following are the default recommended groups in SharePoint:

1. Owners

2. Contributors

3. Visitors

We can assign Permission Levels to groups. The recommended permission level to groups is:

1. Owners group can be assigned Full Control permission level

2. Members group can be assigned Contribute permission level

3. Visitors group can be assigned Read permission level


How to assign Permissions?

For assigning permissions, open the permission page.

clip_image007

For granting permission to a particular user, choose the Grant Permissions button. In the appearing dialog enter the user/group name, resolve it, select permission levels & click the OK button.

clip_image009

In the permissions page, you can see the new item is added.

clip_image011


What are the securable objects in SharePoint?

Following are the Securable Objects in SharePoint:

1. Site

2. List

3. Library

4. Item

5. Document

6. Folder

clip_image013

SPGroup & SPUser

Inside the Server Object Model, SharePoint Groups are represented through type SPGroup. SharePoint Users (Active Directory User/Group, Windows User) are represented through SPUser.

References

http://bit.ly/YoKoX8

Summary

In this article we have explored an overview of Permissions. In the upcoming chapters you can see the Permission Toolbar items, Best Practices & Free Tools to work with Permissions.

Posted in SharePoint, Uncategorized | Tagged: , | 1 Comment »

Squadron – Active Directory Add-in

Posted by Paul on April 26, 2013

In this article we can explore about the Active Directory Add-in of Squadron.

What is Active Directory Add-in?

Active Directory Add-in allows quick lookup of the Active Directory users & groups. For SharePoint installations, Active Directory is the directory service which stores security objects. While working with Permissions, we need to explore the available users & groups in Active Directory. This Add-in helps with the functionality.

clip_image001

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

clip_image002

Types of Active Directory Groups

I would like to emphasize that we are mainly focusing on 3 types entities in Active Directory.

1. User

2. Security Group

3. Distribution Group

A User is an entity representing an individual user.

A Security Group represents collection of users representing usually a Department. (Vertical)

A Distribution Group will be an email distribution group based on location. (Horizontal)

In SharePoint, we can only assign Permissions to User & Security Group.


Generating Report

After installing Squadron, you can execute it from Start Menu > SharePointCTO > Squadron. On loading the primary screen enter your SharePoint URL in the top text box.

clip_image004

You can see that the Domain name is automatically fetched. If you need to change it you can do so.

Now, click on the Active Directory item from the left pane.

clip_image006

You will get the following screen.

clip_image008

Click on the Execute button to generate the report. The Highlight Disabled option highlights the disabled users/groups in red color.

clip_image010


Saving Report

For saving the report, right click on the Grid & choose from the options:

1. Save as Excel

2. Save as CSV

clip_image011

After saving, you can see the file opened in associated application.

clip_image013

Properties Window

We can also use the Properties Window on the right hand side to explore properties of user/group. Click on the grid item to view the properties in the right hand side.

clip_image015

This completes our Active Directory Add-in information. I hope you like the functionality & beautiful lookNfeel.

References

http://bit.ly/10uiVpB

Summary

In this article we have explored about the Active Directory Add-in of Squadron. I believe this Add-in would be another needy too in the hands of a SharePoint Explorer.

Posted in SharePoint, Uncategorized | Tagged: , , | Leave a Comment »

Squadron Diagnostics Add-in

Posted by Paul on April 25, 2013

In this article we can explore a new Add-in integrated into Squadron.

clip_image002

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

clip_image004

What is Diagnostics?

Diagnostics allows you to perform validations periodically. For example: Site Administrators run the following reports on monthly basis:

· Site Collection Size Information

· Permissions are set for Groups

· No obsolete workflows exists

· No obsolete alerts exists

· No dead accounts are in use

Etc.

How to view Diagnostics Screen?

After installing Squadron, you can execute it from Start Menu & click the Diagnostics item on the left side. Please ensure you entered the site url correctly.

clip_image006

I am explaining each of the visible Diagnostics items.


Dead Accounts

Dead Accounts are those with Active Directory Disabled Status. Periodically we might need to remove the dead accounts from SharePoint Permission Associations.

You can click the Execute button against Dead Accounts row to start the check.

clip_image007

If no problems found, the bar will be green. You can click the Details link for viewing further information. Using the Details screen we can manually locate the items & fix the problems.

Dead Alerts

Dead Alerts are those Alerts created by users & the users do not exists or being disabled. We can find the alerts through the Dead Alerts diagnostics item.

You can click the Execute button against Dead Alerts row to start the check.

clip_image008

If no problems found, the bar will be green. You can click the Details link for viewing further information. Using the Details screen we can manually locate the items & fix the problems.


Direct Permissions

Microsoft recommends Permissions to be assigned to SharePoint Groups instead of directly assigning to users. Groups enable more manageability, reusability & ease of clarity. We can find Direct Permission items through this diagnostic item.

You can click the Execute button against Direct Permissions row to start the check.

clip_image009

If no problems found, the bar will be green. You can click the Details link for viewing further information. Using the Details screen we can manually locate the items & fix the problems.

In the above case it is red and clicking the Details link, you can see the problem locations.

clip_image011

This concludes our overview of Squadron > Diagnostics.


References

http://www.sharepointcto.com/Squadron

Summary

In this article we have explored the Diagnostics Add-in of Squadron. Diagnostics are essentials to be executed on periodic basis like every one month. For SharePoint Governance enabled organizations, the need for more Diagnostics tools exists.

In future I hope to see more functionality integrated into Diagnostics add-in. You can also give inputs on your Diagnostics requirement.

Posted in SharePoint, Uncategorized | Tagged: , , , | Leave a Comment »

SharePoint 2013 Apps Explored

Posted by Paul on April 23, 2013

An overview of SharePoint 2013 Office Store Apps is posted @ SharePointCTO!

You can visit using the link below.

http://www.sharepointcto.com/View.aspx?id=20

image

Posted in C# | Leave a Comment »

SharePoint 2013 New Features

Posted by Paul on April 21, 2013

I have created a PowerPoint Slide (PPT) describing features of SharePoint 2013.

It could be useful in refreshing for interviews, demonstrating to clients, deciding on upgrade etc.

Please click the link below to read..

image

Please let me know your comments here..

Note: Existing subscribers can register in site SharePointCTO for SharePoint 2013 articles.

Posted in C# | Leave a Comment »

SharePoint 2013 Apps Explored

Posted by Paul on April 21, 2013

An overview of SharePoint 2013 Office Store Apps is posted @ SharePointCTO!

You can visit using the link below.

http://www.sharepointcto.com/View.aspx?id=20

image

Posted in SharePoint, Uncategorized | Tagged: , , , | Leave a Comment »

How to get SharePoint Solutions through Code?

Posted by Paul on April 21, 2013

In this article we can explore how to get SharePoint Solutions through code. We are using Server Object Model to retrieve the solutions.

As you know there are 2 types of Solutions in SharePoint:

1. Sandboxed Solutions

2. Farm Solutions

Are Sandboxed & Farm Solutions retrieved differently?

Yes! They both are deployed through different methods & they are retrieved through different object models.

clip_image002

Sandboxed Solution is represented by SPUserSolution class & Farm Solution is represented by SPFarmSolution class.

How to get Sandboxed Solutions?

Sandboxed Solutions are deployed in the Site Collection level. (Feature Activation is different where we activate both for Site Collection & Site levels)

Following is the property to get User Solutions.

site.Solutions

Following is the code to retrieve all User Solutions in a Site Collection:

using (SPSite site = new SPSite("http://localhost"))

{

foreach (SPUserSolution solution in site.Solutions)

{

Console.WriteLine(solution.Name);

Console.WriteLine(solution.SolutionId);

Console.WriteLine(solution.Status);

}

}

How to get Farm Solutions?

Farm Solutions exists in the Farm level. Following is the property to get Farm Solutions.

SPFarm.Local.Solutions

Following is the code to retrieve all Farm Solutions.

foreach (SPSolution solution in SPFarm.Local.Solutions)

{

Console.WriteLine(solution.Name);

Console.WriteLine(solution.SolutionId);

Console.WriteLine(solution.Status);

}

Now let us see installing solutions through the Server Object Model.

Install Sandboxed Solution

Installation of a Solution is a 2 step process consisting of:

1. Adding Solution to Gallery

2. Activating Solution

Following is the code to add solution to gallery:

using (SPSite site = new SPSite("http://localhost"))

{

SPDocumentLibrary gallery

=(SPDocumentLibrary)site.GetCatalog(SPListTemplateType.SolutionCatalog);

SPFile file = gallery.RootFolder.Files.Add("SandboxedSolution.wsp",

File.ReadAllBytes("SandboxedSolution.wsp"));

SPUserSolution solution = site.Solutions.Add(file.Item.ID);

}

Remove Sandboxed Solution

For removing a solution & deactivating its features, following code can be used:

using (SPSite site = new SPSite("http://localhost"))

{

SPUserSolution solution = site.Solutions.Cast<SPUserSolution>().

Where(s => s.Name == "Your Solution").First();

site.Solutions.Remove(solution);

}



Install Farm Solution

For installing Farm Solution, following code can be used:

private static void InstallFarmSolution()

{

SPSolution solution = SPFarm.Local.Solutions.Add("File Path here");

solution.Deploy(DateTime.Now, true, GetAllWebApplications(), true);

}

We need to specify the solution path for the above method. The solution will be installed to all web applications as per the above code. The body of GetAllWebApplications() method is given below.

public static Collection<SPWebApplication> GetAllWebApplications()

{

Collection<SPWebApplication> result = new Collection<SPWebApplication>();

SPServiceCollection services = SPFarm.Local.Services;

foreach (SPService s in services)

{

if (s is SPWebService)

{

SPWebService webService = (SPWebService)s;

foreach (SPWebApplication webApp in webService.WebApplications)

{

result.Add(webApp);

}

}

}

return result;

}

Remove Farm Solution

Removing Farm Solution is termed as Retract Solution. You can find the appropriate method in:

private void RetractFarmSolution(SPSolution solution)

{

solution.Retract(DateTime.Now);

}

A timer job will be created to Retract the solution. You can specify the time to start retraction.

For removing solution only from a specified web applications, there is an overloaded method.

private void RetractFarmSolution(SPSolution solution, Collection<SPWebApplication> webApplications)

{

solution.Retract(DateTime.Now, webApplications);

}



References

http://msdn.microsoft.com/en-us/library/ee361616.aspx

http://msdn.microsoft.com/en-us/library/hh528516(v=office.14).aspx

Summary

In this article we have explored how to use the Server Object Model to retrieve Sandboxed & Farm Solutions through code.

For reference please note that:

1. Sandboxed Solution is represented as SPUserSolution

2. Farm Solution is represented as SPFarmSolution

Posted in C# | Leave a Comment »

SharePoint 2013 New Features

Posted by Paul on April 20, 2013

I have created a PowerPoint Slide (PPT) describing features of SharePoint 2013.

It could be useful in refreshing for interviews, demonstrating to clients, deciding on upgrade etc.

Please click the link below to read..

image

Please let me know your comments here..

Note: Existing subscribers can register in site SharePointCTO for SharePoint 2013 articles.

Posted in SharePoint, Uncategorized | Tagged: , , , | Leave a Comment »

How to get SharePoint Solutions through Code?

Posted by Paul on April 18, 2013

In this article we can explore how to get SharePoint Solutions through code. We are using Server Object Model to retrieve the solutions.

As you know there are 2 types of Solutions in SharePoint:

1. Sandboxed Solutions

2. Farm Solutions

Are Sandboxed & Farm Solutions retrieved differently?

Yes! They both are deployed through different methods & they are retrieved through different object models.

clip_image002

Sandboxed Solution is represented by SPUserSolution class & Farm Solution is represented by SPFarmSolution class.

How to get Sandboxed Solutions?

Sandboxed Solutions are deployed in the Site Collection level. (Feature Activation is different where we activate both for Site Collection & Site levels)

Following is the property to get User Solutions.

site.Solutions

Following is the code to retrieve all User Solutions in a Site Collection:

using (SPSite site = new SPSite("http://localhost"))

{

foreach (SPUserSolution solution in site.Solutions)

{

Console.WriteLine(solution.Name);

Console.WriteLine(solution.SolutionId);

Console.WriteLine(solution.Status);

}

}

How to get Farm Solutions?

Farm Solutions exists in the Farm level. Following is the property to get Farm Solutions.

SPFarm.Local.Solutions

Following is the code to retrieve all Farm Solutions.

foreach (SPSolution solution in SPFarm.Local.Solutions)

{

Console.WriteLine(solution.Name);

Console.WriteLine(solution.SolutionId);

Console.WriteLine(solution.Status);

}

Now let us see installing solutions through the Server Object Model.

Install Sandboxed Solution

Installation of a Solution is a 2 step process consisting of:

1. Adding Solution to Gallery

2. Activating Solution

Following is the code to add solution to gallery:

using (SPSite site = new SPSite("http://localhost&quot;))

{

SPDocumentLibrary gallery

=(SPDocumentLibrary)site.GetCatalog(SPListTemplateType.SolutionCatalog);

SPFile file = gallery.RootFolder.Files.Add("SandboxedSolution.wsp",

File.ReadAllBytes("SandboxedSolution.wsp"));

SPUserSolution solution = site.Solutions.Add(file.Item.ID);

}

Remove Sandboxed Solution

For removing a solution & deactivating its features, following code can be used:

using (SPSite site = new SPSite("http://localhost&quot;))

{

SPUserSolution solution = site.Solutions.Cast<SPUserSolution>().

Where(s => s.Name == "Your Solution").First();

site.Solutions.Remove(solution);

}

Install Farm Solution

For installing Farm Solution, following code can be used:

private static void InstallFarmSolution()

{

SPSolution solution = SPFarm.Local.Solutions.Add("File Path here");

solution.Deploy(DateTime.Now, true, GetAllWebApplications(), true);

}

We need to specify the solution path for the above method. The solution will be installed to all web applications as per the above code. The body of GetAllWebApplications() method is given below.

public static Collection<SPWebApplication> GetAllWebApplications()

{

Collection<SPWebApplication> result = new Collection<SPWebApplication>();

SPServiceCollection services = SPFarm.Local.Services;

foreach (SPService s in services)

{

if (s is SPWebService)

{

SPWebService webService = (SPWebService)s;

foreach (SPWebApplication webApp in webService.WebApplications)

{

result.Add(webApp);

}

}

}

return result;

}

Remove Farm Solution

Removing Farm Solution is termed as Retract Solution. You can find the appropriate method in:

private void RetractFarmSolution(SPSolution solution)

{

solution.Retract(DateTime.Now);

}

A timer job will be created to Retract the solution. You can specify the time to start retraction.

For removing solution only from a specified web applications, there is an overloaded method.

private void RetractFarmSolution(SPSolution solution, Collection<SPWebApplication> webApplications)

{

solution.Retract(DateTime.Now, webApplications);

}

References

http://msdn.microsoft.com/en-us/library/ee361616.aspx

http://msdn.microsoft.com/en-us/library/hh528516(v=office.14).aspx

Summary

In this article we have explored how to use the Server Object Model to retrieve Sandboxed & Farm Solutions through code.

For reference please note that:

1. Sandboxed Solution is represented as SPUserSolution

2. Farm Solution is represented as SPFarmSolution

Posted in SharePoint, Uncategorized | Tagged: , , | Leave a Comment »