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 March, 2013

Squadron – Backup & Restore Permissions

Posted by Paul on March 31, 2013

In this article we can explore a new feature in Squadron for SharePoint 2010.

clip_image002

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

clip_image004

What is Backup & Restore Permissions Add-in?

This is a new add-in in SharePoint that allows backing up existing permissions in SharePoint securable object & restoring it elsewhere.

Following are the levels of backup possible:

· Web Application

· Site Collection

· Site

· List

· Item

Squadron also provides URL based filtering for backing up permissions. This will enable speed, context & reduce size of backup data.

What is contained in Permissions?

Following are the content of Permission:

1. Title

2. URL

3. User/Group Name

4. Members in Group

5. Owner if Group

6. Role Assigned

How to perform Backup?

Please follow the steps to perform backup:

Step 1: Execute Squadron

Execute Squadron from Start Menu > SharePointCTO folder. In the appearing scree se the URL.

clip_image006

Step 2: Click Permissions

From the left pane, click the Permissions item.

clip_image008

Step 3: Click Backup

Click on the Backup button in the appearing screen. You will get the following wizard.

clip_image010

Step 4: Check the Items

Expand the Web Application root item & Check the items to be backed up. You can right click & choose Check All command to check the sub items.

clip_image012

You can also use the Filter By Url on the bottom to filter by url.

Click the Next button to continue.

Step 5: View Permissions

In the next page you will see the Iterated Permissions as shown below:

clip_image014

The first column shows the Title of the Site / List / Item. The Type is displayed in the second column. The Url column is the key-column which will be used to identify the item uniquely.

The PermissionType column displays whether the permission is Unique or Inherited. The remaining rows contains the SharePoint Group / Domain User along with the role assignment.

Role Assignment can be Full Control, Contribute, Read or Custom Level.

Click the Next button to Save the file.

Step 6: Choose File

In the next page, choose the file name for saving the backup.

clip_image016

Step 7: Final Page

On clicking Next button you will see the last page which displays summary of the export.

clip_image018

It displays the number of web items, list items, library items along with unique/inherit permission types.

Click the Finish button to close the wizard.

Now we have successfully performed the Backup operation.

The file generated is in excel format & you may edit it for further optimizations. Please ensure the format of columns are retained.

Note: Please note that Folders (SPFolder) inside list/library are not included in permission backup.

How to perform Restore?

In the restore wizard, we are using a previous backup file to restore in a UAT/Production system. Click the Restore button from the Permissions Add-in.

clip_image020

You need to select the backup file in the next page.

clip_image022

In the next page you will be displayed the file contents as shown below:

clip_image024

In the next page choose the URL of the site to perform the backup.

clip_image002[1]

Please note that the URL column of backup file will be used to match the target items.

Please note that this feature is only available for SharePoint 2010.

clip_image026

On clicking Next you can see the matching URLs.

clip_image028

You can verify the Source Objects in file & the Destination Objects in the destination Site URL specified.

On clicking Next you will see the Confirm prompt.

clip_image030

Click the Yes button to continue..

The restore operation will be performed & you can see the result as shown below:

clip_image032

This concludes our Restore Operation.

References

Permissions & Permission Levels http://bit.ly/YoKoX8

Summary

In this article we have explore the new feature in Squadron 2010. I believe this feature will be useful in backing up existing permissions before applying new ones. The Backup & Restore can be applied combined in scenarios of UAT Backup & Production Restore OR vice-versa.

Advertisements

Posted in C#, SharePoint | Tagged: , , , | Leave a Comment »

Squadron – Backup & Restore Permissions

Posted by Paul on March 31, 2013

In this article we can explore a new feature in Squadron for SharePoint 2010.

clip_image002

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

clip_image004

What is Backup & Restore Permissions Add-in?

This is a new add-in in SharePoint that allows backing up existing permissions in SharePoint securable object & restoring it elsewhere.

Following are the levels of backup possible:

· Web Application

· Site Collection

· Site

· List

· Item

Squadron also provides URL based filtering for backing up permissions. This will enable speed, context & reduce size of backup data.

What is contained in Permissions?

Following are the content of Permission:

1. Title

2. URL

3. User/Group Name

4. Members in Group

5. Owner if Group

6. Role Assigned

How to perform Backup?

Please follow the steps to perform backup:

Step 1: Execute Squadron

Execute Squadron from Start Menu > SharePointCTO folder. In the appearing scree se the URL.

clip_image006

Step 2: Click Permissions

From the left pane, click the Permissions item.

clip_image008

Step 3: Click Backup

Click on the Backup button in the appearing screen. You will get the following wizard.

clip_image010

Step 4: Check the Items

Expand the Web Application root item & Check the items to be backed up. You can right click & choose Check All command to check the sub items.

clip_image012

You can also use the Filter By Url on the bottom to filter by url.

Click the Next button to continue.

Step 5: View Permissions

In the next page you will see the Iterated Permissions as shown below:

clip_image014

The first column shows the Title of the Site / List / Item. The Type is displayed in the second column. The Url column is the key-column which will be used to identify the item uniquely.

The PermissionType column displays whether the permission is Unique or Inherited. The remaining rows contains the SharePoint Group / Domain User along with the role assignment.

Role Assignment can be Full Control, Contribute, Read or Custom Level.

Click the Next button to Save the file.

Step 6: Choose File

In the next page, choose the file name for saving the backup.

clip_image016

Step 7: Final Page

On clicking Next button you will see the last page which displays summary of the export.

clip_image018

It displays the number of web items, list items, library items along with unique/inherit permission types.

Click the Finish button to close the wizard.

Now we have successfully performed the Backup operation.

The file generated is in excel format & you may edit it for further optimizations. Please ensure the format of columns are retained.

Note: Please note that Folders (SPFolder) inside list/library are not included in permission backup.

How to perform Restore?

In the restore wizard, we are using a previous backup file to restore in a UAT/Production system. Click the Restore button from the Permissions Add-in.

clip_image020

You need to select the backup file in the next page.

clip_image022

In the next page you will be displayed the file contents as shown below:

clip_image024

In the next page choose the URL of the site to perform the backup.

clip_image002[1]

Please note that the URL column of backup file will be used to match the target items.

Please note that this feature is only available for SharePoint 2010.

clip_image026

On clicking Next you can see the matching URLs.

clip_image028

You can verify the Source Objects in file & the Destination Objects in the destination Site URL specified.

On clicking Next you will see the Confirm prompt.

clip_image030

Click the Yes button to continue..

The restore operation will be performed & you can see the result as shown below:

clip_image032

This concludes our Restore Operation.

References

Permissions & Permission Levels http://bit.ly/YoKoX8

Summary

In this article we have explore the new feature in Squadron 2010. I believe this feature will be useful in backing up existing permissions before applying new ones. The Backup & Restore can be applied combined in scenarios of UAT Backup & Production Restore OR vice-versa.

Posted in C# | Leave a Comment »

Squadron Exception >> Unable to find SPDeletedSite…

Posted by Paul on March 29, 2013

While using Squadron you might have faced with following Exception:

image

The exception states unable to load type ‘Microsoft.SharePoint.Administration.SPDeletedSite’ from assembly ‘Microsoft.SharePoint, Version 14.0.0.0’ with Public Key Token

Description of Problem

The stated assembly should be registered in GAC (Global Assembly Cache) for working with Squadron.

Solution

As Squadron is built based on Server Object Model, it is expected to be executed in the SharePoint Server machine.

Following are the solutions recommended:

  1. Execute Squadron from a machine with the above Assemblies installed in GAC
  2. Install above Assemblies to GAC  (http://msdn.microsoft.com/en-us/library/dkkx7f79.aspx)

On Success

After solving the problem, you can execute Squadron again.  If the problem is resolved, you can see the Squadron Main Screen without any errors.

image

Posted in C#, SharePoint | Tagged: , , , | Leave a Comment »

Squadron Exception >> Unable to find SPDeletedSite…

Posted by Paul on March 29, 2013

While using Squadron you might have faced with following Exception:

image

The exception states unable to load type ‘Microsoft.SharePoint.Administration.SPDeletedSite’ from assembly ‘Microsoft.SharePoint, Version 14.0.0.0’ with Public Key Token

Description of Problem

The stated assembly should be registered in GAC (Global Assembly Cache) for working with Squadron.

Solution

As Squadron is built based on Server Object Model, it is expected to be executed in the SharePoint Server machine.

Following are the solutions recommended:

  1. Execute Squadron from a machine with the above Assemblies installed in GAC
  2. Install above Assemblies to GAC  (http://msdn.microsoft.com/en-us/library/dkkx7f79.aspx)

On Success

After solving the problem, you can execute Squadron again.  If the problem is resolved, you can see the Squadron Main Screen without any errors.

image

Posted in C# | Leave a Comment »

Squadron – PowerShell Code Command

Posted by Paul on March 27, 2013

Observing the SharePoint Administrators, I found that they need a tool for examining problems with site/list/item objects & a PowerShell code to fix the problem.

As we already integrated Explorer with Properties in Squadron, I thought of easing their second step of using PowerShell code.

clip_image002

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

clip_image004

What does PowerShell Code button do?

You can see the PowerShell Code button in the Explorer add-in.

clip_image006

The command is only available for:

1. Site Collection

2. Site

3. List

4. List Item

On clicking the command (button) you will get the PowerShell Code to point to the item.

For example, I am selecting the Site Collection object & clicking the button.

clip_image008

You can see the code in above screen. The code can be directly pasted to a PowerShell Editor for execution or debugging.

You need to enter your custom code after the last line of generated code 🙂 The generator helps in saving time skipping the plumbing work.

You can even launch PowerShell & PowerShell ISE using the buttons displayed.

Generate List Item Code

Both List & Library are internally Lists for SharePoint. So the list items & documents are the same List Item. You can select the item as shown below.

clip_image010

Click the PowerShell Code button to generate code.

clip_image012

You can launch the PowerShell ISE and paste the code there..

clip_image014

This concludes our article on PowerShell code command in Explorer add-in.

References

http://bit.ly/10uiVpB

Summary

In this article we have explored a possible useful Add-in command option of Squadron. Please let me know about more functionality you need in Squadron.

Posted in C#, SharePoint | Tagged: , , , | Leave a Comment »

SharePoint 2013 Tutorials

Posted by Paul on March 27, 2013

I am writing SharePoint 2013 articles for SharePointCTO web site, link below:

http://www.sharepointcto.com

image

You can find the articles there..

[image]

SharePoint 2013

Introduction

Installation

Basics

Site Collection & Site

List & Library

Web Part

Workflow

Tools

Central Administration

SharePoint Designer

PowerShell


Custom Development

Programming

Apps

Server Object Model

Client Object Model

More

Resources, Tools

Job Track

You are Welcome to visit the site by.. Happy SharePoint 2013!

Posted in C#, SharePoint | Tagged: , , , | 4 Comments »

Squadron – Permissions Add-in

Posted by Paul on March 26, 2013

In this article we can explore the new Permissions Add-in inside Squadron.

clip_image002

Squadron is a Free Administrative Tool for SharePoint. You can download it from:

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

What is inside Permissions Add-in?

Permission Add-in helps with the following tasks:

1. Find permissions of site level, list level, item level

2. Distinguish between Unique & Inherited permissions

3. Save Reports

4. Provides wizards for Find, Copy, Delete, Backup, Restore permissions

clip_image004

Types of Permissions

In a quick overview of Permissions, there are basically 2 types:

Unique Permissions where we assign unique users/groups & permission levels.

Inherited Permissions where the securable object (site, list, item) inherits permissions from its parent.


How to Generate the Report?

Let us examine the steps to generate a report for a site collection.

Step 1: Enter URL

Run Squadron & in the appearing screen, enter the URL of the site. Please note that you should run this in SharePoint Farm Account context.

clip_image006

Step 2: Open Permissions

From the left hand side click the Permissions link.

clip_image008


Step 3: Set Options

You can set the options in the appearing screen.

clip_image010

Site: To include site objects check this item.

List & Library: To include list & library objects check this item.

Item: To include items & documents check this item.

Expand Groups: A permission entry can be a SharePoint Group or User. If it is a SharePoint Group, you might need to include the users contained inside it. Check this item for including users.

Show User Name: The user item will be having a Login Name (eg: DOMAINuser) & a Display Name (eg: Full Name). You can choose this option to include the Display Name of the user as well.

Include Hidden: There could be hidden lists which are not visible in Quick Launch or in the All Site content page. Check this option to include those.

Unique Permissions Only: Check this option if you need only Unique Permission items.

Expand Inherited Groups: Usually the Inherited Permissions will be expanded in the parent object, as it is unique there. This checkbox enables you to expand the inherited groups too.

Filter By: Checking this option will enable a URL textbox where you can enter the URL to filter the result.

Highlight: Highlight Unique Permissions as Yellow & inherited ones as Green.

For the time being I have checked the following options:

clip_image011

Step 4: Generate

For generating the report, click the View Permissions from the left. You can see the result as shown below depending on your Site.

clip_image013

Step 5: Save Report

For saving the report, you need to right click on the grid & choose the option.

clip_image015

1. Save to Excel

2. Save to CSV

You may uncheck the option “Open after save..” if you do not wanted to launch your report file after save.

I have selected the option to save as Excel.

clip_image017

Enter the file name and click the Save button.

You will be viewing the file in Excel after saving.

clip_image019

This concludes our usage of Squadron Permissions add-in.

clip_image020

I wanted to iterate the Microsoft Recommendation of using SharePoint Groups instead of directly adding users to the site/list/item permissions. Groups are more easily manageable & easier understanding.

About the Wizards

The additional wizards are separately documented. Here is the screen shot of thee wizard screens.

clip_image022

References

http://bit.ly/10uiVpB

Summary

In this article we have explored about Squadron Permissions Add-in. I believe in real life scenario the add-in is useful in quickly analyzing a SharePoint site.

Posted in C#, SharePoint | Tagged: , , , | Leave a Comment »

Squadron – Permissions Add-in

Posted by Paul on March 26, 2013

In this article we can explore the new Permissions Add-in inside Squadron.

clip_image002

Squadron is a Free Administrative Tool for SharePoint. You can download it from:

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

What is inside Permissions Add-in?

Permission Add-in helps with the following tasks:

1. Find permissions of site level, list level, item level

2. Distinguish between Unique & Inherited permissions

3. Save Reports

4. Provides wizards for Find, Copy, Delete, Backup, Restore permissions

clip_image004

Types of Permissions

In a quick overview of Permissions, there are basically 2 types:

Unique Permissions where we assign unique users/groups & permission levels.

Inherited Permissions where the securable object (site, list, item) inherits permissions from its parent.


How to Generate the Report?

Let us examine the steps to generate a report for a site collection.

Step 1: Enter URL

Run Squadron & in the appearing screen, enter the URL of the site. Please note that you should run this in SharePoint Farm Account context.

clip_image006

Step 2: Open Permissions

From the left hand side click the Permissions link.

clip_image008


Step 3: Set Options

You can set the options in the appearing screen.

clip_image010

Site: To include site objects check this item.

List & Library: To include list & library objects check this item.

Item: To include items & documents check this item.

Expand Groups: A permission entry can be a SharePoint Group or User. If it is a SharePoint Group, you might need to include the users contained inside it. Check this item for including users.

Show User Name: The user item will be having a Login Name (eg: DOMAIN\user) & a Display Name (eg: Full Name). You can choose this option to include the Display Name of the user as well.

Include Hidden: There could be hidden lists which are not visible in Quick Launch or in the All Site content page. Check this option to include those.

Unique Permissions Only: Check this option if you need only Unique Permission items.

Expand Inherited Groups: Usually the Inherited Permissions will be expanded in the parent object, as it is unique there. This checkbox enables you to expand the inherited groups too.

Filter By: Checking this option will enable a URL textbox where you can enter the URL to filter the result.

Highlight: Highlight Unique Permissions as Yellow & inherited ones as Green.

For the time being I have checked the following options:

clip_image011

Step 4: Generate

For generating the report, click the View Permissions from the left. You can see the result as shown below depending on your Site.

clip_image013

Step 5: Save Report

For saving the report, you need to right click on the grid & choose the option.

clip_image015

1. Save to Excel

2. Save to CSV

You may uncheck the option “Open after save..” if you do not wanted to launch your report file after save.

I have selected the option to save as Excel.

clip_image017

Enter the file name and click the Save button.

You will be viewing the file in Excel after saving.

clip_image019

This concludes our usage of Squadron Permissions add-in.

clip_image020

I wanted to iterate the Microsoft Recommendation of using SharePoint Groups instead of directly adding users to the site/list/item permissions. Groups are more easily manageable & easier understanding.

About the Wizards

The additional wizards are separately documented. Here is the screen shot of thee wizard screens.

clip_image022

References

http://bit.ly/10uiVpB

Summary

In this article we have explored about Squadron Permissions Add-in. I believe in real life scenario the add-in is useful in quickly analyzing a SharePoint site.

Posted in C# | Leave a Comment »

Set Permissions for Views

Posted by Paul on March 23, 2013

I had a requirement from customer to set permissions for Views. You very well know that we cannot set permissions for Views. SharePoint 2010 out-of-the-box does not have support for view permissions.

Scenario

The Research department is having an Ideas Library. Following are the constraints:

1. Each employee can add / edit / delete documents to the library

2. Employee cannot view other employee’s documents

3. Research Head can view all the documents

4. Employee should not be able to change View

How to achieve this?

image

The common way of view creation with filter does not work here as the user may change the view. Plus the item filtering options for Lists & Survey Lists are not available for document libraries.

Users

Following are the users involved in this scenario:

1. Research Head

2. Engineer 1

3. Engineer 2

Solutions

There are 2 solutions for this problem:

· Create multiple views with filtering & use SharePoint Designer to set View Permission

· Modify default view to show only current user items & create a restricted page to show all items

We can try the second approach.


Steps

Step 1: Create Users

As the first step create the following users in Active Directory or in User Accounts.

1. Research Head (researchhead)

2. Engineer 1 (engineer1)

3. Engineer 2 (engineer2)

Step 2: Create Library

Create a new document library named Ideas Library and set contribute permissions for all users.

image

Step 3: Modify View

Open the Library and click on Library tab > Modify View button.

image

Modify the default view of the library by setting filter to [ME]

image

Click OK to save changes.


Step 4: Upload Documents

Open another browser & login as Engineer 1. Upload a document. Repeat the process for Engineer 2.

Now there are 2 documents, but each engineer can view only their documents.

image

Step 5: Create Page

Now create a new page.

image

Set the name of page as All Ideas Page

image

Choose the Insert tab > Existing list option.

image

Choose the Ideas Library and click OK button.

image

Save the changes to page.

image

Step 6: Set Page Permissions

Now choose Page Permissions.

image

Choose Stop Inheriting Permissions option

image

Delete existing users & add only the Research Head user.

image

Click Ok button to save changes.

image

image

If the buttons are not enabled, you might need to refresh the page.

Step 7: Test the Page

You can open the page from Site Actions > View All Site Content > Site Pages library.

image

Now you can try logging in as Research Head & the page should display all document items.

image

So this concludes our article. Now the engineers can post their ideas, without seeing each other’s. The Research Head can view all the submitted ideas. All are happy J

References

http://bit.ly/10uiVpB

Summary

In this article we have explored a real world scenario of setting permissions for views, although not direcly.

Posted in C#, SharePoint | Tagged: , , | Leave a Comment »

KNOWLEDGE SHEET – Stale Objects & HTTP 500 Error

Posted by Paul on March 20, 2013

KNOWLEDGESHEET

 

Stale Objects & HTTP 500 Error

 

 

Scenario – I was working for Squadron > Permissions management module. The SPWeb objects in collection were invoking Update() method multiple times.  Additionally the same SPWeb object were used in child SPList objects.  As these SPWeb objects were obsolete, invoking the Parentweb.Update() from child objects made the entire web application fault by HTTP 500 error.

 

 

Solution: Create new SPWeb objects in the child list again

 

public void InvokeUpdate(SPList list)

 

{

 

  SPSecurity.RunWithElevatedPrivileges(delegate()

 

  {

 

    using (SPSite site = new SPSite(list.ParentWeb.Site.Id))

 

    {

 

      using (SPWeb web = site.OpenWeb(list.ParentWeb.Id))

 

      {

 

        site.AllowUnsafeUpdates = true;

 

        site.Update();

 

        site.AllowUnsafeUpdate = false;

 

      }

 

    }   

 

  });

 

}

 

Posted in C#, SharePoint | Tagged: , , | Leave a Comment »