Tuesday, January 12, 2016

Site Settings Part 3 ( Site Administration )

Introduction
Welcome back to the third part of Site Settings in SharePoint 2013. Today, we will cover the most important part of Site Administration. As you see from the screen shot below, let us discuss about them one by one.

Regional Settings
As we are aware from the previous versions of SharePoint Regional settings, we can change the Time Zone, Region and Calendar Configurations.

Language Settings
We don’t need to translate for our site as we can configure it to our own need as we can see in the below screen.

Site Libraries & Lists
Here, we can see all the libraries and lists in the site where when we click on a particular list to customize and it will take you to the list or Document library settings page.

User Alerts
As per the below screen shot, we don’t see any alerts but if you add any alerts in any of the lists, it will come up here so you can globally see them here and delete if you want.

RSS
As we can see from the screen shot, we can Enable RSS Feeds, providing the copyright, Managing Editor, Webmasters and Time to Live values.

Sites & Workspaces
Here, we will be able to see all the sites and workspaces attached to the Site along with their Description, Date of Creation and an option to delete them.

Workflow Settings
Below we can see Workflows. All the workflows along with their current status will be present in the Site settings under Workflow Settings. We can also track the current status of the Workflows which are in progress.

Site Closure & Deletion
Below, we can see option for closing the site now as an App, just a click and the site will close. Then we have an option to delete the site and lastly we can set Site Policy which will delete or close the site automatically.

Site Output Cache
Here, you can specify a cache profile for the caching page output for users and it will also receive the cache output of the authenticated users. As per the screen shot, we can see a configuration output for cache profiles.

Term Store Management
It is a very good feature in its own mane which states Term Store Management.
It helps developer as setting up a search module, making navigation tabs on the site and that too in a hierarchical manner, then we have dictionaries enabling, etc .
In short, it has lot of stuff and soon one of my articles will be based on Term Store Management.

Popularity Trends
As we can see in the screen below, Popularity trends is nothing but an Excel report generation with the documents most modified or downloaded in the site.
Content and Structure
When you come in here in Site settings, you will see the all contents of your site including your sub site’s. I have colored them up so that you don’t see some peculiar test names.

Manage Catalog Connections
When you come up here, you will be able to connect your site to a catalog, Once you click on it, you will see the below icon to connect to a catalog.
All catalogs you will add up will be shown here in the below view:
Content and Structure Logs
As in here, we can see it maintains the logs of all the updates as we will make any changes to the application, to any list, to any document.

Site Variation Settings
This feature is used to create and manage local specific sites in this site collection by getting sync the content to one or sites.
Here, you can create Label and Hierarchies. You can also set up Variation Settings and receive Variation Logs.

Translation Status
This is a new feature in 2013 where you can create a new item as per the below form.

Here, you can export the time schedule for job completion and export by providing the below details.



References :  Microsoft and codeproject

Site Settings Part 2 ( Web Designer Galleries )

in Part 2, we will discuss about the Web Designer Galleries. Here, we can see Site columns, Site content types, Web Parts, List templates, Master pages and page layouts, Themes, Solutions and Composed looks.
We will see how to create a site column and publish it.
As you can see below:
 Site Columns:
Let’s discuss about them one by one so starting with Site Columns as you can see, we can create Site Column from anywhere in the list or the document library where it will come up in the following way in the Site settings under the Site columns.
The difference between the two types is that when you create a column inside your list or library, this column is only available there. Therefore, if you need the same column in another list or library afterwards, you will have to create it once again. The Site Column helps you find an answer by providing a reusable column within your site and sub sites
It will show you the type of the column and the source of it as we can see below:


In Part 8, we will see how to create site columns and how to use those in list or libraries.

Content Types:
A content type defines the metadata, workflow, and behavior for a category of items in a SharePoint list or document library. For example, you can create a content type for information in a contacts list or a task list. A contact content type might include columns such as Name, Email, Telephone Number, and Address. A content type that you define at the site level is independent of any list or document library in the site. You can use the same content type with different lists or document libraries on the SharePoint site. You can also use several content types on the same list or document library.
We can see Site Content Types as you can see we can create Content Type from anywhere in the list or the document library where it will come up in the following way in the Site settings under the Site Content Types.
It will show you the type of the column and the source of it as we can see below:


Then, we have Web Part Gallery, where we can see all our Web Parts placed in here with their Modified By and Modified Date along with their recommendation settings which is required to install them.


In a similar way, we have List Template Gallery, where we can see all our custom lists placed in here with their Modified By and Modified Date along with their product version, Feature ID and Language of the List Templates.

Then we have Master Page Gallery storing all our master pages.


Below, we can see Theme Gallery where we can see our existing themes as well as we can upload new themes in it from here in the Theme Gallery.

Then we have Solutions, which stores all the custom solutions. In here, you can upload a solution, activate or deactivate a solution and even upgrade a solution.

Then, we have something new here as Composed Looks which states the color of the site and most importantly it tells from which Master Page or Theme it is inheriting that feature.
It also has an Image URL if they are inheriting an image and they too have Font Scheme URL if they are inheriting it from a style for the look and feel of the site.


 References : Microsoft and Codeproject

Site Setting in SharePoint 2013 ( Part 1) Permissions


Below, you can see a screen shot on the site settings page in SharePoint 2013. I will divide this page into parts so that I may cover each of them in an easy way for my readers to understand.

we will cover up Users and Permissions.


 Firstly, under site settings, we have People and groups where we have default groups as well as custom groups which are added through site permissions.
So, it’s like a place having all the users and groups at one place.
Then, we have Site Permissions.
First, we have Manage Parent where you can add Users and Groups and assign them to the parent level of permissions.
Then, we have in there as Stop Inheriting Permissions where you can give your site a unique set of permissions or can inherit from the Top level site.


We have Grant permissions where you can provide permissions to users as well as groups as Owners, Approvers, Designers, Full Control, Read, Contribute and View access.

We have Create Groups as we can see we have the following input form to fill in the details as name, about it, the group owner, who can view the membership, who can leave the membership, who can allow users to join or leave the group, Auto accept requests and lastly who should receive an email to approve users to join in the group.


Lastly, we have Site App Permissions which is new in 2013 version. Here, it displays all the app’s permission level with the identifier.


If you are site collection administrator, we can see Site collection administrators columns at the end of app permissions column, where we can add or edit site collection administrator group. 

Reference : Microsoft & Codeproject

Monday, January 11, 2016

How to edit a page that has no "Edit Page" menu option in SharePoint

Once you are at the page you want to add a web part to, add the following to the URL:

To change everyone's view of a particular page, append 

?PageView=Shared&ToolPaneView=2 to the URL.

To change your private view of a particular page, append ?PageView=Personal&ToolPaneView=2 to the URL (this will only work on pages that allow you to have a personal view - to see if you can edit a personal view of a page, go to the page and click on the top right context menu beside the "Welcome, <your name>" link to see if there's a menu option called "Personalise this page").


At the end of the URL, that is after the .aspx, put a '?' then the value below, to use more than one use an '&'

QuerystringFunction
Contents=1This is probably the most useful of querystrings. Using this on any "Web Part Page" will take you to what is called the "Web Part Page Maintenance" page (screenshot below) which allows you to delete web parts from both personal and shared views. This feature is especially useful if you have added a misbehaving web part. In this situation you can find yourself in a "chicken and egg" situation, whereby you can’t access the page to remove the web part because the web part you have added is causing an error on the page.
Note: I have actually come across a situation where even this technique couldn’t remove a misbehaving web part, in this situation FrontPage becomes the only option.
Mode=EditThis flips a "Web Part Page" into edit mode, its the same as clicking on "Edit Page"
Mode=ViewThis flips a "Web Part Page" into view mode, it’s the same as clicking on "View Page"
PageView=PersonalDisplays your Personal view of a "Web Part Page", this is the same as selecting "Personal View" from the "Modify Shared/My Page" dropdown.
PageView=SharedDisplays the Shared view of a web part page, this is the same as selecting “Personal View” from the "Modify Shared/My Page" dropdown.
ToolPaneView=2Shows the "Add Web Parts" toolpane, allowing you to drag and drop web parts onto a "Web Part Page".
ToolPaneView=3Shows the "Search" toolpane, letting you search through the web part galleries before adding a web part to the page.
Finally (there is always a finally isn't there?) a couple of things that should be considered:
1. These querystrings *will* respect the underlying SharePoint permissions, so for example, someone without the ability to add web parts will not suddenly be able to by using these querystrings.
2. These will let you add web part to pages that may not have been designed to have web parts added to them, for example the "Sites" page. Be very careful as there are certainly some issues to be discovered, don't try and get too fancy!
3. You use these at your own risk.


If you don't want to start filtering using a Form Web Part then using FilterField / FilterValue pairs is a nice easy route: 

?FilterField1={column name}&FilterValue1={required value}



Thursday, January 7, 2016

BackUp and Restore Process in SharePoint

Backup and Restore in SharePoint 

It is essential to have proper backup/restore strategy in place for your SharePoint farms. SharePoint 2010 provides three types of tools for backup/restore for your server farm. The tools are                             

You need to carefully decide what you are going to backing up and where you are storing these backups. Be noted that SharePoint 2010 doesn’t provide a method to backup directly to tape. SharePoint 2010 backs up to a UNC file share. Technically UNC file share can be anywhere, but it is recommended that you take your backup to a UNC file share in your LAN.
Let me explore each tool available for backup.

Central Administration: You cannot schedule a backup via Central Administration. The primary use of Central Administration backups is to verify the configuration of the target backup location and to back up server farms before major operations. It is recommended to take backup using Central Administration, once you create all web applications and site collections required by your server farm. Also take one backup using Central Administration before any major upgrade of the farm.

Windows PowerShell: The preferred way to take backups in SharePoint Server 2010 is by using windows PowerShell. This method gives you the most options and will be fully supported in the future. You can also schedule the backup using Windows PowerShell.

Stsadm.exe: Stsadm was the command line administration tool available for SharePoint 2007. SharePoint 2010 also provides Stsadm, but it is recommended to use PowerShell as Stsadm is there to offer backward compatibility. Many of the Stsadm commands implemented in SharePoint Server 2010 existed in SharePoint Server 2007. Configuring command-line backups using Stsadm is easy, but it is limited to basic farm backup functionality

In this article I am going to demonstrate the PowerShell commandlets to take various types of backup from SharePoint 2010.
First you need to decide, where you are going to store the backups. Make a UNC share for that location. In order to back up to file share, the following accounts need full permissions to the backup location.

  1. SQL Server service account
  2. SharePoint 2010 Timer Log On account
  3. User account, who is executing the command.
Also you have to ensure that you have enough disk space available for the backup. In the remaining section of this article details the various backup options available to you.

Farm Backup
To back up a server farm using Windows PowerShell, you can use Backup-SPFarm command. The syntax of the command is as follows.

Backup-SPFarm -directory <UNC File Share> -BackupMethod <Full | Differential>

The Backup-SPFarm supports the following options
  • Directory - Defines the backup location previously prepared.
  • BackupThreads - The default thread count is 3. Increasing the thread count will result in faster backup, but it will affect the server performance during backup. Also increasing the threads will make it difficult to check backup logs.
  • ShowTree - Displays the objects in the farm those are available to be backed up. If you use this setting in conjunction with Item, it is scoped to the object underneath Item.
  • ConfigurationOnly – This option specifies to backup only the farm configuration data. No content will be backed up when you specify ConfigurationOnly in the command.
  • Item – You can back up a farm component—such as a Web application, content database, or service application—using the Item parameter. You cannot back up site collections, sites, list, libraries, or list items using the Item parameter.
  • Percentage - You can specify the progress increments on the screen. If scripting, you do not need to use the Percentage option.
  • Force - Using force will bypass the default behavior of halting the backup if the estimator calculates there is insufficient disk space.
  • Verbose – This option will display the progress of the backup in the command line. If this is not presented, you won’t be presented with current progress information.
  • WhatIf - This is a common PowerShell feature, if you specify this option, the command will display the output of running the backup without actually performing the backup.
Restore a Server Farm

The backups taken by PowerShell can be restored by Central Administration. Also it is possible to restore the farm using the PowerShell Script. To restore a farm from backup you can use Restore-SPFarm commandlet.
The UNC share where you configured your backup, may contains more than one backup. So the PowerShell command for restore requires you to specify the backup ID for the backup to restore. No problem, there is a command available to list all the backups available under a UNC share. The command is as follows.

Get-SPBackupHistory -Directory <Backup folder> -ShowBackup [-Verbose]

There is another way to find the backup ID, in the root folder of the UNC share used for backup; you can find an xml file named spbrtoc.xml (SharePoint Backup Restore Table Of Contents). To find the ID, open the UNC share in windows explorer, open the spbrtoc.xml in any text editor (e.g. notepad) and you can find all backups with IDs]
The syntax for Restore-SPFarm command is as follows
Restore-SPFarm -Directory UNCShare -BackupId <id of backup>
The Restore-SPFarm supports the following options.
  • Directory - specifies the path to the SharePoint Server 2010 backup location you want to restore from. There must be a valid spbrtoc.xml file in the root of the backup directory.
  • RestoreMethod – Either New or Overwrite. The New option restores the selected backup components and configuration using either new database names or a new SQL Server instance, or both. The Overwrite option restores the content and configuration to the same database instances.
  • BackupId - The unique backup ID you want to restore.
  • ConfigurationOnly - Restores only the farm configuration data, it will not restore any content.
  • Confirm - Requires you to confirm the backup by typing Y, it is just a precautionary option.
  • FarmCredentials - You must supply the farm credentials when restoring content and configuration data.
  • Force – if you want to restore to the existing farm, use this option.
  • Item - Indicates the part of the backup you want to restore. For example, if you have performed a full farm backup, you might choose to only restore a Web application or content database.
  • NewDatabaseServer - If you want to restore to an alternate database server, you can specify that during the restore process.
  • Percentage - You can specify the progress increments on the screen. Percentage complete is seen only when using the Verbose option.
  • RestoreThreads - The default number of process threads is 3. This can be increased to 10 or decreased to 1.
  • WhatIf - Displays the effect of a command without running an actual restore process.
  • Verbose - Displays the output of a command.

Backup web applications using PowerShell

You can use the –item option to the Backup-SPFarm command to back up a particular component in a farm. By specifying the item option with the Backup-SPFarm command, you can backup a web application, a service application or a content database. Also using the Restore-SPFarm command, you can restore any of these.
You can also restore individual items from a full back up without restoring the entire farm backup. So if you are taking full farm backup, it is not necessary to take item wise backups separately.
In order to backup an item, you need to specify the item name you need to backup. To retrieve the item names for backing up, you can use the following command.

Backup-SPFarm –showtree

This command will list the hierarchical items available in the farm. You can retrieve the item name by following the command output.

To backup a particular item, you can

Backup-spfarm –directory <uncpath> -item “Hierarchical item name” –backupmethod FULL |Differential
e.g.:

Backup-spfarm –directory \\ServerName\UNCShare -item “Farm\ Microsoft SharePoint Foundation Web Application\SharePoint - 2038” –backupmethod FULL

Similarly you can Restore a particular item from a farm backup. See the sample command

Restore-SPFarm –directory <uncpath> -backupid <backup id> -item <item to be backed up>

Backup Site Collection

Sharepoint 2010 supports granular backup and restore. You can backup/restore site collections, individual sites and lists. In this section I am going to cover only the site collection backup.
Windows PowerShell will automatically lock the site collection during backup to reduce the risk of SQL blocking and locking errors. Also it is possible to backup site collection using a SQL snapshot to back up the data. To backup site collections you can use the command Backup-SPSite. The following are the options available for Backup-SPSite.
  • Identity - specifies the URL or GUID of the site collection to back up
  • Path -The full backup path, including the file name.  Here you can use the file path, it is not necessary to specify the UNC path here. 
  • Confirm - Requires you to confirm the backup by typing Y.
  • Force - If you want to overwrite an existing back up file, use the Force option.
  • NoSiteLock - If you want to back up the site collection without making it read-only, use the NoSiteLock option. If you are taking large site collection backups, without a site lock, the back up may fail.
  • UseSqlSnapshot - If you need to back up site collections during the day and require users to continue full read/write operations, you’ll need to create a SQL snapshot to back up from. Using this option creates a temporary SQL Server database snapshot. After the snapshot is created, the backup will be from the snapshot, not the live database. This is the best method to get a full fidelity site collection backup.
  • WhatIf Shows the effects of a command without performing the actual backup
E.G.: Backup-spsite –identity http://win-hgdsnnuakhv/sites/testsite -path c:\sitebkup\mysite.bak

Schedule backups
Once the server farm is up and running, you need to take regular backups. You need to automate the server backup procedure. You need to decide your backup plan. This depends on your farm. You need to carefully decide the backup plan. Also test your back up by restoring it to a test environment, for making sure you are ready for disaster recovery.
Providing a recommendation for backup farm is depends on the implementation. Recently I worked with a farm, where I have 3 site collections in 3 different web applications. I have decided the following backup sets.
  1. Monthly full backup for the entire server farm
  2. Weekly differential backup for the entire server farm
  3. Weekly full backup for each site collection
  4. Daily differential backup for each site collection
Make sure you are taking the decision by carefully considering your back up plans.
Next you need to schedule the scripts. You need to do the following tasks for scheduling the back up.
  1. Create a .ps1 file with your PowerShell commands
  2. Create a batch file that calls the ps1 file
  3. Configure the batch file to execute in certain interval.
The following steps demonstrate scheduling a full farm backup using PowerShell. First create a Windows PowerShell script file with the following contents.
Add-PSSnapin Microsoft.SharePoint.PowerShell
Backup-SPFarm -directory \\win-hgdsnnuakhv\farmbkup -backupmethod FULL
Save this file with extension .ps1. I have named the file as farmfullbkup.ps1.
Now create a batch file, which calls this PowerShell Script. The batch file content is as follows.
PowerShell -command C:\BackupScheduleScripts\FarmFullBkup.ps1
Save this file with extension .bat. In my case, I named the file as FarmFullBkup.bat
Now you can schedule this batch file as you required using Windows task scheduler. In my case I configured this to execute once in a month.
Conclusion
SharePoint provides lot of options for backup/ restore, from a full farm level to list level. Planning for backup / restore in very important in any server farm and you need to carefully decide what backup / restore strategy will help you.

SharePoint PowerShell Backup and Restore Commands

The following are examples of different SharePoint PowerShell commands you can use to back up and restore various components of your SharePoint environment.

A complete farm backup followed by a restore:
Backup-SPFarm –Directory \\App01\SharePointBackups -BackupMethod Full
Restore-SPFarm –Directory \\App01\SharePointBackups -RestoreMethod New
Backup and restore a service application:
Backup-SPFarm –Directory \\App01\SharePointBackups -BackupMethod Full –Item "Excel Services"
Restore-SPFarm –Directory \\App01\SharePointBackups -RestoreMethod New –Item "Excel Services"
Backup and restore farm configuration information only:
Backup-SPConfigurationDatabase –Directory \\App01\SharePointBackups
Restore-SPFarm –Directory \\App01\SharePointBackups –RestoreMethod Overwrite –ConfigurationOnly
Backup and restore your SharePoint content databases:
Backup-SPFarm –Directory \\App01\SharePointBackups -BackupMethod Full –Item ContosoPortal
Restore-SPFarm –Directory \\App01\SharePointBackups -RestoreMethod New –Item ContosoPortal
Backup and restore a site collection:
Backup-SPSite –Identity http://App01/Sites/ContosoPortal -Path \\App01\SharePointBackups\PortalSiteCollection.bak -Force
Restore-SPSite –Identity http://App01/Sites/ContosoPortal -Path \\App01\SharePointBackups\PortalSiteCollection.bak –Force
Export and import a subsite, list, or library:
Export-SPWeb –Identity http://App01/Sites/ContosoPortal/ -Path \\App01\SharePointBackups\SharedDocuments.bak -Itemurl "Shared Documents" -Force
Import-SPWeb –Identity http://App01/Sites/ContosoPortal/ -Path \\App01\SharePointBackups\SharedDocuments.bak –Force -IncludeUserSecurity

SharePoint STSADM Backup and Restore Commands

The following are examples of different STSADM commands you can use to back up and restore various components of your SharePoint environment.

A full farm backup followed by a restore:
stsadm -o backup -url http://app01/ -directory \\app01\sharepointbackups -BackupMethod Full -Quiet
stsadm -o restore -url http://app01/ -filename \\app01\sharepointbackups –Overwrite
Back up and restore configuration information only:
stsadm -o backup -url http://app01 -directory \\app01\sharepointbackups -configurationonly -quiet
stsadm -o restore -url http://app01 -filename \\app01\sharepointbackups -configurationonly –quiet
Back up and restore a service application:
stsadm -o backup -directory \\app01\sharepointbackups -quiet -backupmethod full -item "Excel Services"
stsadm -o restore -directory \\app01\sharepointbackups -item "Excel Services" –quiet
Back up and restore a site collection:
stsadm -o backup -url http://app01/portalsitecollection -filename \\app01\SharePointBackups\portalsitecollection.bak -overwrite
stsadm -o restore -url http://app01/portalsitecollection -filename \\app01\SharePointBackups\portalsitecollection.bak –overwrite
Export and import a subsite, list, or library:
stsadm -o export –url http://app01/sites/contosoportal/Shared%20documents –filename \\app01\sharepointbackups\SD.bak -quiet -overwrite
stsadm -o import –url http://app01/sites/contosoportal/Shared%20documents –filename \\app01\sharepointbackups\SD.bak -quiet