Tuesday, April 23, 2013

Using PowerShell with Office 365


Given below are the quick steps to connect to your Office 365 site with PowerShell. As the first thing you need to download "SharePoint Online Management Shell". Get the correct version (x64 or x86) and run the setup.

Then run SharePoint Management Shell (if you have SharePoint in your machine) or SharePoint Online Management Shell.
In my case I already have a SharePoint Online site, if you don't, go to office.microsoft.com and give it a try.
After that go to the admin site and check the availability as it's the admin URL you need to connect to with the Connect-SPOService cmdlet.
With the credential parameter you need to pass a user with admin privileges to your Office 365 site. If it's one of your domain yours, make sure your domain is connected to the office 365 environment with ADFS.
It will ask for your password.
OK, the next thing is to find out the stuff you can do with PowerShell in O365. Simple, type cmdlet help SPO or Get-Command -Module Microsoft.Online.SharePoint.PowerShell in shell window.
Simply, you are through. Try out the listed cmdlets.


Monday, February 4, 2013

Installing and configuring Workflow for SharePoint Server 2013

When you open SharePoint Designer 2013 connected to a site to build a workflow, you will notice a new option called platform type. If it’s only “SharePoint 2010 Workflow” that you see, you need to install and configure “workflow manager”.

As MSDN recommends, you need to consider the following two key factors before configuring Workflow Manager to work with SharePoint Server 2013.

  • Is Workflow Manager installed on a server that is part of the SharePoint farm?
  • Will communication between Workflow Manager and SharePoint Server 2013 use HTTP or HTTPS?

These factors translate into four scenarios. Each scenario configures a SharePoint Server 2013 farm to communicate and function with the Workflow Manager farm. Follow the scenario that matches your circumstance.

  1. Workflow Manager is installed on a server that is part of the SharePoint 2013 farm. Communication takes place by using HTTP.
  2. Workflow Manager is installed on a server that is part of the SharePoint 2013 farm. Communication takes place by using HTTPS.
  3. Workflow Manager is installed on a server that is NOT part of the SharePoint 2013 farm. Communication takes place by using HTTP.
  4. Workflow Manager is installed on a server that is NOT part of the SharePoint 2013 farm. Communication takes place by using HTTPS.

Mine is the 1st scenario. Workflow Manager can be downloaded from here. Workflow Manager installation uses Web Platform Installer as shown in the below screen.
image
image 
Then you need to install the prerequisites. 
image
image
image
Clicking continue will bring the configuration options.
image 
I prefer to go with the custom setting as I can get to know what’s going on behind scene. If you select the “Configure Workflow Manager with Default Settings (Recommended)”, it will install a Workflow Manager farm. So let’s move with custom :)
In the below screen you need to specify the database server, where it will create the DBs needed for WM(Workflow Manager).
image
Make sure you remember or keep safe the Certificate Generation Key, as it’s needed when you want to add more servers to the WM farm.
image
Service account will be used to run the Application pool of the WM Website.
image 
Below screen looks nice so added that too :D
image
image
image
image
Three screens below show the full configuration summary.
image
image
image
You can even see the full PowerShell script for the configuration.
image
image
image
image
Great!! You are done with the installation and the configuration of Workflow Manager. Yet one more step left for the Workflows to work in 2013 Platform. Open IIS Manager to see the WM Site and the port you configured.
image
Open SharePoint Management Shell with Admin rights and execute the below cmdlet (replacing the site and the Workflow Manager host site).

Register-SPWorkflowService –SPSite "http://www.whiteknight.com/Hr" –WorkflowHostUri "http://workflow.whiteknight.com:12291" –AllowOAuthHttp

Finally to check whether everything works fine… Open the above site (registered with workflow host uri) in SharePoint Designer 2013 and check the Platform type in workflow.
Workflow Manager 1.0
When you install Workflow Manager on a WFE it automatically installs the Workflow Manager Client on that WFE. You will still need to install the Workflow Manager Client on any additional WFE servers.

Saturday, December 22, 2012

SQL Does Not Have the Required MaxDegree of Parallelism Setting of 1

I was installing SharePoint 2013 and while running the SharePoint Products Configuration Wizard it failed suddenly displaying the error "This SQL Service instance does not have the required maxdegree of parallelism setting of 1. Database provisioning operations will continue to fail if maxdegree of parallelism is not set 1 or the current account does not have permissions to change the setting..."

Before solving the issue, let see what this "maxdegree of parallelism".

"When SQL Server runs on a computer with more than one microprocessor or CPU, it detects the best degree of parallelism, that is, the number of processors employed to run a single statement, for each parallel plan execution. You can use the max degree of parallelism option to limit the number of processors to use in parallel plan execution. To enable the server to determine the maximum degree of parallelism, set this option to 0, the default value. Setting maximum degree of parallelism to 0 allows SQL Server to use all the available processors up to 64 processors. To suppress parallel plan generation, set max degree of parallelism to 1. Set the value to a number greater than 1 to restrict the maximum number of processors used by a single query execution. The maximum value for thedegree of parallelism setting is controlled by the edition of SQL Server, CPU type, and operating system. If a value greater than the number of available processors is specified, the actual number of available processors is used. If the computer has only one processor, the max degree of parallelism value is ignored."
Source


You have two options to fix the issue...
1st Option

Open SQL Server Management Studio and execute the below command
sp_configure 'show advanced options', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
sp_configure 'max degree of parallelism', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO

2nd Option
Open SQL Server Management Studio right click the SQL Server instance and click properties. Change the "Max Degree of Parallelism" value from 0 to 1.
 You are not done yet :)

As the SharePoint Products Configuration Wizard ran half way, the configuration database is already created. So make sure to delete the database before you run the Products Configuration Wizard again.

This problem occurs only if you execute the wizard with least privileges. If you ran the wizard with a high privileged account (If SharePoint Setup admin has sysadmin rights to the DB Server), it will automatically do the changes and continue the wizard for you.

Thursday, December 20, 2012

Configure Excel Services in SharePoint 2013

Finally I got some time to configure my SharePoint 2013 farm. So I thought of using the chance to update my blog too. "Two birds with one stone".
Central Administration > System Settings > Manage services on server
Start "Excel Calculations Services"
Once it's started the next step is to create a new instance of "Excel Service Application" (in one doesnt exist already).
Central Administration > Application Management > Manage service applications and create  a new "Excel Service Application"

You are done with configuring Excel Servcies. As the next step you need to configure the tusted locations where Excel Service will only load Excel Workbooks from.

Central Administration > Application Management > Manage service applications > Excel Servce Application (This will change based on how you named the servcie instance on the previous step) > Trusted File Locations
Fill the Address with a Document Library location. I have created a document library called "Excel Documents" in a site called "Team".
In the External Data section you have "Allow External Data", select the Trusted data connection libraries and embedded option.

Set both the Automatic refresh and Manual refresh values to 0 (But this is not recommend as it will consume more resources by refreshing workbook results immediately).
Now as we have a trusted file location, we can now publish data-connected workbooks with embedded data connections. But for Excel Services to correctly render data-connected workbooks with external data connections, we must configure a trusted data connection library.


Central Administration > Application Management > Manage service applications > Excel Servcie Application > Trusted Data Connection Libraris
Make sure you have a "Data Connection Library" type library. Name of my data connection library is "Data Connections" which is created in a site called "Team".
Now you have successfully completed with Excel service configuration.

Monday, October 22, 2012

Office 2013 RTM Announced


On 11th October 2012 Microsoft sent Office 2013 to manufacture. Which means they officially announced the RTM (Release To Manufacture).

This includes Office 2013, SharePoint 2013, Lync 2013 and Exchange 2013.

Sunday, July 29, 2012

Classic Authentication in SharePoint 2013

The first thing you will note while creating a New Web Application in SharePoint 2013 is the missing option button to select the Authentication, Classic or Claims.

image

In SharePoint 2013 (Preview), claims-based authentication is the default and preferred method of user authentication and is required to take advantage of server-to-server authentication and app authentication. If you create a Web Application in Central Administration, by default it’ll be based on claims authentication. The use of classic mode authentication (Windows classic authentication) is discouraged in SharePoint 2013 Preview and you can only create or configure web applications for classic mode authentication with Windows PowerShell cmdlets.

Create a Web Application that uses Classic Authentication in PowerShell
New-SPWebApplication -Name <Name> -ApplicationPool <ApplicationPool> -AuthenticationMethod <WindowsAuthType> -ApplicationPoolAccount <ApplicationPoolAccount> -Port <Port> -URL <URL>

<Nameis the name of the new web application. 
<ApplicationPoolis the name of the application pool. 
< WindowsAuthType > is either “NTLM” or “Kerberos”. Kerberos is recommended.
<ApplicationPoolAccountis the user account that this application pool will run as. 
<Portis the port on which the web application will be created in IIS. 
<URLis the public URL for the web application.

Example:

New-SPWebApplication -Name "WhiteKnight Inc" -ApplicationPool "ContosoAppPool" -AuthenticationMethod "Kerberos" -ApplicationPoolAccount (Get-SPManagedAccount "WhiteKnight\SPServiceApp") -Port 80 -URL "https://www.whiteknight.com

Migrate from classic-mode to claims-based authentication in SharePoint 2013 Preview

Wednesday, February 15, 2012

SharePoint Formulas and Functions

While working with a SharePoint List, I wanted to add couple of Columns with Formulas and I came across the below url from Microsoft.

Formulas are equations that perform calculations on values in a list. A formula starts with an equal sign (=).”

Functions are predefined formulas that perform calculations by using specific values, called arguments, in a particular order, or structure. Functions can be used to perform simple or complex calculations. For example, the ROUND function rounds off a number in the Cost column.”