A Practical Guide to SharePoint 2013

A Practical Guide to SharePoint 2013
A Practical Guide to SharePoint 2013 - Book by Saifullah Shafiq

Monday, March 31, 2014

Configure eDiscovery for SharePoint Server 2013

The Test Lab Guide (TLG), Configure eDiscovery for SharePoint Server 2013, describes how to configure eDiscovery in SharePoint Server 2013.
This TLG takes you through the following eDiscovery configuration steps:
    1. Install the Exchange Web Service API 1.2 (EwsManagedApi.msi)  
    2. Configure a trust relationship between SharePoint 2013 and Exchange Server 2013.
    3. Configure Exchange Server 2013 for SharePoint 2013’s eDiscovery center.
    4. Configure Search to crawl all discoverable content.
    5. Grant permissions.
    6. Create an eDiscovery center.
The resulting test lab is a place for you to begin learning more about eDiscovery configuration in SharePoint Server 2013. 

Read more

Saturday, March 29, 2014

Setting Up Extranet - Part 1

Setup SharePoint 2013 Extranet


We have covered all important topics that lay ground work for creating Extranet sites. Here is what is needed for creating Extranets:
1.       Web application and site collection setup
2.       SSL setup – This is optional but highly recommended if you are allowing data exchange with external entities.
3.       Binding SharePoint site with SSL certificate
4.       Setup of users database
5.       Central admin and web.config configurations
6.       Testing
Remember, most of the topics mentioned above are optional. For example, you may not want to have a unique URL for your extranet site. You may be ok with the machine name in the URL but in case, if you want to have a unique URL for your site, read following article:
This article explains how to setup DNS and  FQDN. So, instead of accessing your site with URL http://sp2013, you can access it using URL like http://www.walisystems.com
If you want to setup separate URLs for different departments in your organization, read following article:
If you want to setup SSL for your extranet site, there are three ways which are described in the below articles:


There are different options for setting up Extranets. You can use LDAP, you can use custom database, or you can use OpenID. In this article, you will learn to use custom database. By default, authentication type in SharePoint 2013 is claims-based. To access custom database or data source like LDAP (Lightweight Directory Access Protocol), forms-based authentication has to be configured in web application settings.  Forms-based authentication is an identity management system that is based on ASP.NET membership and role provider authentication.  SharePoint 2013 supports a variety of authentication methods and authentication providers for the following authentication types:
Ø  Windows authentication
Ø  Forms-based authentication
Ø  SAML token-based authentication
Advantage of using claims-based authentication is that you can setup multiple authentication methods in one zone but there are two restrictions that apply:
Ø  You can implement only one instance of forms-based authentication on a zone.
Ø  Central administration allows you to use both an Integrated Windows method and Basic at the same time.

Setup database


To use SQL Membership Provider, first you need to install ASPNETDB database. ASP.NET includes a tool for installing the SQL Server database used by the SqlMembershipProvider and SqlRoleProvider. The Aspnet_regsql.exe tool is located in the drive:\Windows\Microsoft.Net\Framework64\v4.0.30319
If you try to create web application that uses Forms-based authentication using SQL Membership Provider database, you get error message: “Sorry, Something went wrong” and it gives you a correlation ID which when you check in the logs shows several errors, for example, the following:
Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue)  at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(IClaimsIdentity claimsIdentity, String encodedIdentityClaimSuffix)     at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedIdentityClaimSuffix)     at Microsoft.SharePoint.Utilities.SPUtility.GetFullUserKeyFromLoginName(String loginName)     at Microsoft.SharePoint.ApplicationRuntime.SPHeaderManager.AddIsapiHeaders(HttpContext context, String encodedUrl, NameValueCollection headers)
The error occurs because Membership provider and Role manager have not been configured yet. We can configure web.config first and then create the application but let’s first install the database.
1.       Double-click Aspnet_regsql.exe to start the wizard.
2.       Click Next.
3.       Choose first option Configure SQL Server for application services. You can use same wizard to remove application services information from an existing database. Click Next.

4.       Enter database server name. Default method for accessing database is Windows authentication. If you have set up SQL server user ID and password, you can choose SQL Server authentication. Click Next.

5.       Click Next.
6.       Click Finish.

Adding Users in Database


Database has been installed but it is empty. Next step is to add users in the database. You can use MembershipSeeder application to add users. This application can be downloaded from codeplex:
Second option is to build your own .NET application that will provide interface to add data in the database.
Third option, the one I used, is to add data manually in the database.  This is ok if you want to add users for testing may be once or twice but in production environment where adding and removing users is an ongoing task, you need to have an interface to do this easily. Below, I show you how to add some test data so that we can continue with the application setup but before adding test data, we must give permissions to the accounts that will access this database.
7.       Open Microsoft SQL Server Management Studio.
8.       First we need to add account that we will use in new web application to the newly created database. You can use admin account in the new web application but standard practice is to use special service account for SharePoint applications. I have named this service account “spservice” and I will add it to the database permissions. Also you need to check what account STS (SecurityTokenService) uses. Open IIS manager.

Expand server name node, click Application Pools. Check Identity column again SecurityTokenServiceApplicationPool. This account (WALISYSTEMS\Administrator) must be added in the database permissions.
9.       There are two ways to accomplish this. You can add these accounts directly in the ASPNETDB database permissions or you can add them to the sysadmin role, that will automatically give them permissions on all databases. To add these accounts in sysadmin role, do the following:
a.       In management studio, expand Security node.
b.      Expand Server Roles.

c.       Double-click sysadmin.

Part 2
Part 3

Friday, March 28, 2014

Announcing the Office you love, now on the iPad

Today in San Francisco, we made some exciting announcements about our company’s mobile first, cloud first approach. Office played a big part in today’s news. Over a billion people on the planet use Microsoft Office to get more done at work and at home. Every day we hear from you how important it is to have a great productivity experience on all the devices you use. We take that very seriously – we know that means you want the authentic experience of Office, made right for the device you’re using.  Whether you’re creating an Excel spreadsheet on your tablet, authoring aWord document in the browser or making edits to a PowerPoint on your phone, you want the great Office experience you love, everywhere you are. Today, we unveiled Office for iPad®

Read More!!

Sharepoint online part 2

Part 1

All devices listed above in the figure are supported. As an example, we will set it up for iPhone in this section. In the software section, click phone & tablet link on the left side then click on iPhone. Click get apps button. It will take you to another page. Enter your mobile number and click Submit to receive a link in the form of a SMS or you can directly open the link www.office.com/business-apps on your mobile device. The mobile apps shown below are available on your iPhone:

§  Word
§  Excel
§  PowerPoint
§  OneNote
§  OWA
§  Lync
§  SharePoint

You see following page when you open the above link. Click on OWA to go to the App Store and install the application. It’s free.

Figure 11-10: Office Web Apps

After installing, click Open to open the application. Click continue and login with your username and password (for your SharePoint online site). It may take a few seconds to find your server. After a few seconds, you will see a welcome screen. You will be prompted to allow OWA to access your contacts. Click Ok.

Once signed in, you can switch between Mail, Calendar, People and Options by tapping on the icon in the bottom left corner of the app.


Figure 11-11: Navigation

This takes you to a navigation screen with titles you can tap to reach the desired module.


Figure 11-12: Say it

You can tell your device what you want it to do. Tap and hold the “go to” button and say what you want the application to do. This is a great feature but isn’t available in all languages.


Figure 11-13
: Manage mail

A quick swipe of each list view item reveals a set of actions such as delete, flag, move and mark as read/unread. In the Inbox, you see all messages. In Calendar, you can add new events. You can easily swipe from day-to-day, week-to-week or month-to-month, and you can tap on any calendar item to display a preview of the event details.  In the People, you see all contacts. Your OWA contacts are automatically synced to the native address book on the device.

You can also setup Office 365 email on your iPhone using SMTP settings. The server name for IMAP and POP is outlook.office365.com and the server name for SMTP is smtp.office365.com. These settings can be used if you are using the latest version of Office 365.

          
Figure 11-14: Email settings in iPhone

Go to iPhone settings and select Mail, Contacts, and Calendars. Select Add Account. Select Other. Select Add Mail Account. Add Name, Email, and Password and hit Next. Under Incoming Mail Server, enter outlook.office365.com in the Host Name field. Enter your email address in the User Name field. Under Outgoing Mail Server, enter smtp.office365.com in the Host Name. Hit Next. Hit Save to save the settings. Now go to Mails (Tap Mail icon on your device), you will see new account listed there. Tap the link to see the emails.


Tuesday, March 25, 2014

SharePoint Branding Part 4

Changing Styles


You can customize the style of the pages by changing the style sheets. Styling is provided by the core files. You can overwrite default styles in your CSS. For example, if home page is loaded in the IE, press F12 to open the debugger. Press Ctrl+B to select element by click (This option is available under the Find menu). Click the element for which you want to change the style. Debugger shows you the file name where the style is located and the style itself. Copy the style to your custom CSS and apply new setting. For example, below you will change the color of the Suite Bar.

1.      Load home page in IE. Press F12. Select Select element by click from the Find menu and select the Suite Bar.


Figure 12-9: Suite Bar

2.      Note the style under the Style tab.

Figure 12-10: Styles

To change the color of the Suite Bar, copy following code to the custom CSS file (main.css), at the bottom. You can access css file from the mapped folder.



#suiteBarLeft {
background-color: #008ba9;
}
#suiteBarRight {
background-color: #008ba9;
}


 Listing 12-6: Custom styles

Before applying new style, this is how Suite Bar looked:


Figure 12-11: Original Suite Bar Color

This is how updated Suite Bar looks (You won’t notice the color change if you are reading a printed book because the images are mono color):



Figure 12-12
: New Suite Bar Color

Adding Snippets

A snippet is an HTML representation of a SharePoint component or control such as a navigation bar or a Web Part. Using the snippet gallery, you can quickly add SharePoint functionality to your pages. Using snippet gallery, you can do the following:

§  Choose a component from the gallery
§  Configure the properties of the component
§  Preview the appearance in the browser
§  Copy it anywhere in your page





Figure 12-13
: Snippets (Ribbon)

1.      To insert a snippet, browse to the website.

2.      Go to Site Actions > Site settings > Design Manager.

3.      Click Edit Master Pages on the left side.

4.      Click on the default page to open it.

5.      Click on the Snippets link in the upper-right corner.

6.      Open Design tab to view all snippets. Once you click a snippet, the page re-loads and shows you a preview of that snippet, the properties for that snippet, and the HTML code snippet that you can copy and paste into your master page. The properties are grouped into different tabs. Expand each tab to see the properties contained within. You can set values for the properties. After you configure properties, choose Update to update the HTML snippet. The HTML snippet is automatically updated. Once you are done changing the properties’ values, you can copy the HTML and paste it on to your master page. Click Copy to Clipboard to copy the snippet to the clipboard.

Customizing Search Box

Now that you have seen how snippets work, let’s customize the Search Box in our site. In the HTML template, we had just used a text box and a button. Now, we need a functional search box that should return results from the site. To achieve this, we will add Search Box snippet to our master page.

1.      To insert Search Box snippet, browse to the website.

2.      Go to Site Actions > Site settings > Design Manager.

3.      Click Edit Master Pages on the left side.

4.      Click on the default (master page) to open it.

5.      Click on the Snippets link in the upper-right corner.

6.      Select Search Box snippet from the ribbon.

7.      Since you will use custom style, you don’t have to change the properties. Click Copy to Clipboard button.

8.      Go to mapped network drive and open master page in an editor.

9.      Locate <div class=”search”> tag.

10.  Copy the Search Box snippet between <div class=”search”> and </div> tags overwriting whatever is in between. Here is how the div tag looks before copying the snippet:

<div class="search">
               <input type="text" class="search_box" />
               <input type="button" class="search_button" value="Search" />
</div>


Listing 12-7: Search code HTML

After copying snippet, search div looks like this:

<div class="search">
<div data-name="SearchBox">
<!--CS: Start Search Box
 Snippet--><!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>--><!--MS:<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox">--><!--PS: Start of READ-ONLY PREVIEW (do not modify)--><div class="ms-webpart-chrome ms-webpart-chrome-fullWidth "><div WebPartID="00000000-0000-0000-0000-000000000000" HasPers="true" id="WebPart" width="100%" class="ms-WPBody noindex " OnlyForMePart="true" allowDelete="false" style="">
<div componentid="ctl00_SmallSearchInputBox_csr" id="ctl00_SmallSearchInputBox_csr"><div id="SearchBox" name="Control"><div class="ms-srch-sb ms-srch-sb-border" id="ctl00_SmallSearchInputBox_csr_sboxdiv">
<input type="text" value="Search..." maxlength="2048"
accessKey="S"
title="Search..." id="ctl00_SmallSearchInputBox_csr_sbox" autocomplete="off" autocorrect="off" onkeypress="EnsureScriptFunc('Search.ClientControls.js', 'Srch.U',
function() {if (Srch.U.isEnterKey(String.fromCharCode(event.keyCode))) {$find('ctl00_SmallSearchInputBox_csr').search($get('
ctl00_SmallSearchInputBox_csr_sbox').value);return Srch.U.cancelEvent(event);}})" onkeydown="EnsureScriptFunc('Search.ClientControls.js',
 'Srch.U', function() {var ctl = $find('ctl00_SmallSearchInputBox_csr');ctl.
activateDefaultQuerySuggestionBehavior();})" onfocus="EnsureScriptFunc('Search.ClientControls.js', 'Srch.U',
 function() {var ctl = $find('ctl00_SmallSearchInputBox_csr');ctl.hidePrompt();
ctl.setBorder(true);})" onblur="EnsureScriptFunc('Search.ClientControls.js', 'Srch.U', function() {var ctl = $find('ctl00_SmallSearchInputBox_csr');
if (ctl){ ctl.showPrompt(); ctl.setBorder(false);}})" class="ms-textSmall ms-srch-sb-prompt ms-helperText" /><a title="Search" class=
"ms-srch-sb-searchLink"
id="ctl00_SmallSearchInputBox_csr_SearchLink" onclick="EnsureScriptFunc('Search.ClientControls.js', 'Srch.U', function() {$find('ctl00_SmallSearchInputBox_csr').search($get(
'ctl00_SmallSearchInputBox_csr_sbox').value);})" href="javascript: {}"><img src="/_catalogs/theme/Themed/E97CFE0A/searchresultui-61174269.themedpng?ctag=4" class="ms-srch-sb-searchImg" id="searchImg" alt="Search" /></a></div></div></div><noscript><div id="ctl00_SmallSearchInputBox_noscript">It looks like your browser does not have JavaScript enabled. Please turn on JavaScript and try again.</div></noscript><div id="ctl00_SmallSearchInputBox"></div><div class="ms-clear"></div></div></div><!--PE: End of READ-ONLY PREVIEW--><!--ME:</SharePoint:DelegateControl>--><!--CE: End Search Box Snippet-->
</div>
</div>


Listing 12-8: Search snippet

The code above looks jumbled up. The portions that are of your interest have been emboldened. Since the search box that we had used was just a place holder and did not add any value to the site, we will keep the search box created by the snippet above but that does not mean you cannot modify the look and feel of the search box. You can change the look and feel by customizing the styles. As explained earlier in the chapter, use F12 key to open IE debugger, select the elements you want changed, copy the styles to your custom CSS and modify them. To clarify the process, I will slightly modify the custom CSS for the search box. Since we are using the snippet generated by the SharePoint, we don’t need the text box and search button styling that we had in our CSS, therefore, we are going to remove those styles from our CSS.

11.  Open main.css (from the mapped drive > social > css folder) in editor. Locate the following two lines and remove them since we don’t need them anymore but even if you keep them they won’t harm you since they are not being called any more.
.search_box{width:68%; float:left; background-color:#fdfdfd; border:1px solid #e5f0f3; padding:3% 1%; border-right:0; font-family: 'SegoeWPLight';}

.search_button{width:28%; float:left; background-color:#008ba9; border:none; color:#FFF;padding:3% 1%; text-transform:uppercase; font-family: 'SegoeWPLight'; cursor:pointer}

Listing 12-9: Search styling

The style that we are interested in is as following:


.search{width:40%; float:right; margin-top:15px}


Listing 12-10: Search box adjustment

Since we have removed the Search button and now we are using the default image (lens), either we need to increase the length of the search box or we need to slightly move it to the right to bring it closer to the right border. We will decrease the width from 40% to 25% and that will move the search box closer to the right border. Updated style looks as following:


.search{width:25%; float:right; margin-top:15px}


Listing 12-11: Updated search box adjustment

That is it. We have our search box and this is what we will keep on the site. If you want to experiment a bit more for your learning please continue reading. If you want to change the style of the search box, for example, background color, change square corners to rounded corners, etc, copy following style to your custom CSS just under the .search class.

#SearchBox .search, #SearchBox .ms-srch-sb-border, #SearchBox .ms-srch-sb-borderFocused  {
                background-color: #e5f0f3;
                float: right;
                height: auto;
                width: auto;
                padding: 0 0 0 2px;
                -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            -khtml-border-radius: 5px;
            border-radius: 5px;
                margin-right:10px;
}

Listing 12-12: Stylize search box

This style will change the background of the search box to light sky blue and square corners to rounded corners. This is how the search box will look:



Figure 12-14: Stylish Search Box

If you want to add more style to the search box, for example, if you want to change the search image, add following styles to your custom css (main.css):


#SearchBox .ms-srch-sb input[type=text]{
                background-image:url(../images/search_bg.png);
                background-repeat:repeat-x;
                height:20px;
                padding-top:4px;
                width:190px;
                border:none;
                float:left;
                margin:2px 0 0px 0;
                color:#d1d3d4;
                padding-left:10px;
}

#SearchBox .ms-srch-sb-searchImg {
                height:30px;
                margin-left: -19px;
    width: 28px;
                border:none;
                float:left;

}

.ms-srch-sb > .ms-srch-sb-searchLink {
background-image:url(../images/search_btn.png);
                background-repeat:repeat-x;
                height:30px;
margin-left: -19px;
    width: 28px;
                border:none;
                background-color:transparent;
                                float:left;
                                cursor:pointer
}


Listing 12-13
: More styles for the search box

In the above styles, we change the background color of the search box to bluish silver and add a gradient to it. We also change the image button to a more stylish button that has a bigger lens image and has stylish border. The images used in the above styles are in the images folder.


Figure 12-15
: More styles for the search box

I have commented out the above styles in the main.css. If you want to use them, just uncomment the code and feel free to add your own customizations.