Thursday, July 30, 2015

Introduction
One of the main purposes of SharePoint is collaboration: a group of people can conveniently work with shared documents, making teamwork especially efficient. Usually, text documents are created and edited using Microsoft Word, but when the work is complete, it is convenient to convert the resulting document to PDF. This gives two advantages:

No further changes to a document are possible, so it can be safely shared

The PDF document can be easily viewed on any device

A Word document can be saved manually as a PDF file right from Microsoft Word’s Save As… menu, but if we talk about tens or even hundreds of documents per week, it would obviously be preferable to have this conversion running automatically. Another thing is that if we browse the short list of workflow actions in SharePoint Designer, we won't find anything related to document conversion. This is where HarePoint Workflow Extensions can help.

Scenario
In this article, we will follow this scenario:

While the team actively works with a document in the document library Active Docs, it has the status "Work in progress". As soon as the job is done the status is set to Completed.

The workflow triggers and converts this Word document to PDF.

When the PDF file has been created, the workflow moves the original Word document to Document Sources library. Only selected team members (such as managers, etc) have access to this document library.

As a result, only the PDF file remains in the original document library, so everyone can view and share this document. This way, the document can be opened easily (also on any mobile device), and at the same time no deliberate or inadvertent changes can be made.

As was mentioned in Introduction, we’re going to use HarePoint Workflow Extensions to perform this automated Word to PDF conversion. So we have the product installed (detailed information about HarePoint Workflow Extensions and its deployment is available on the product homepage: https://www.harepoint.com/Products/HarePointWorkflowExtensions/ and we are ready to go.

Creating a workflow
We can start creating a workflow. This is
performed with SharePoint Designer, like we are used to. On the ribbon
click New List Workflow for Active Docs list:

A dialog window for creation of a new list workflow will be displayed. Enter a workflow name and optionally a description. Important: select the SharePoint 2010 Workflow Platform Type in the drop-down menu, since HarePoint Workflow Extensions uses the 2010 platform type.

Since in our scenario the workflow will be launched every time the document is changed (but not when created), the first action we need to check is whether the document has the Status set to Completed (otherwise no action should be taken).

In first parameter, select Current Item. Other parameters can be left as default:

The document conversion is not an immediate process, so in order to find out when the conversion has completed, we need to use the Wait Conversion Job action from HarePoint Activities – Document Conversion category:

In the parameter, select Variable:ConversionJobId (it’s the variable that is used in the previous workflow action) using the lookup:

The workflow will stay on this action until the conversion is completed.
Finally, we will move the original document to Document Sources library that is accessible only for selected team members.

In the second parameter (document URL) specify Current Item: Encoded Absolute URL using the lookup:

In the third parameter specify the full URL of the target library:
(typically that looks like http://servername/sitename/subsitename/.../documentlibraryname/)

Here’s what we have in SharePoint Designer:

Save the workflow. Modify the workflow Start Options in SharePoint Designer to make it run every time the document is changed, but not when created:

Save and Publish the workflow.

Testing a workflow
Now we can make a test. Add a Word document to Active Docs library.

The document will have an empty status field by default (this is how the Status field is set up).

When the work on this document begins, team members edit the document and set the status to Work In Progress:

The workflow triggers, but completes with no actions taken, just as expected.

Now, change the status of the document to Completed:

First, we notice the workflow status is now In Progress:

After some time, all the Word document is gone and only the converted PDF remains in Active Docs:

Then, if we take a look at the Document Sources folder (where only selected team members have access), we see the original Word document:

Conclusion
In this article we have reviewed an example of rather simple but efficient workflow for a Team working with shared documents, and have seen how quickly and easily the solution can be achieved by using HarePoint Workflow Extensions – just a couple of actions in SharePoint Designer and no code at all.

Tuesday, July 28, 2015

Introduction:

Virto SharePoint Calendar Web Part enables users to view all of their events from multiple data sources such as SharePoint Lists, Exchange Calendar,
Google Calendar, SalesForce Calendar, SQL Tables or XML
and have different views for your easy navigation and reference in one single calendar/or Microsoft
Exchange calendars and even from SalesForce Calendars.

Roll up Multiple calendars from different data sources into one Single calendar

The main added value of the SharePoint Calendar web part is the opportunity to
have all the events from different data sources displayed in a single
SharePoint calendar view, sparing the necessity to switch between
multiple views. You can also combine all events from different SharePoint Sites into one calendar!It can show all your events
from different SharePoint 2013, 2010 or 2007 lists too. So you can manage events from different data sources in one calendar.You don't have to synchronize all your calendars from SharePoint, Google, Microsoft
Exchange, SalesForce and etc. Install Virto SharePoint Calendar web part and show
all the events from multiple data sources in a single place. Use as
SharePoint Calendar data sources SharePoint lists from different site collections, SQL
tables, Google calendar, XML source, SharePoint lists from other farm,
Exchange calendar, SalesForce calendar. This is in
comparison to most other SharePoint calendars that can only use one data
source, and be displayed in only one view. To distinguish events from
different sources in Virto SharePoint Calendar Web Part, one can use
multi-level color coding.

Different calendar views (Day, Week, Work Week, Month, Year, Task)

Use
appropriate timescale for showing your calendar events. Task view
allows to control the status of tasks in your SharePoint Calendar web
part. If you need to change the duration of the event, modify the size
of the cell to the required direction and length. To change the date,
simply select the appropriate date in the mini calendar. All of these
features will help you save time and complete your calendar tasks with
the greatest convenience.Virto provides editing features that will make working with SharePoint easy and pleasant. If you need to change the date of the event, simply drag and drop it to the appropriate calendar cell. To
change the event in time frame in SharePoint Calendar, simply expand the
event to incorporate the correct duration of the event.

Color coded data sources

You can visualize the events from your calendars. Customize calendar with special colors for each of data sources and your events will not join anymore! This feature is
especially essential when you have more than 2 data sources in one
calendar. Use any
combination of RGB for coloring events according to their category.

Using Virto SharePoint Calendar Web Part
Virto Calendar implemented in a modern style. The component is fully ready for Windows 8 and SharePoint 2013. Installation is simple and only requires a small amount of time. Currently, Virto supports English, German, Spanish, French, Russian and Chinese Simplified languages. It provides color coding feature that displays items in their SharePoint Calendar web part by category of events (such as internal or external, view day, week, month, year, and Gantt view).

You can contact Virto, If you'd like to add another one language to
support SharePoint Calendar Web Part!

Key Features & Advantages of Virto Calendar Web Part:

Virto SharePoint Web Part Calendar can be used instead of built-in SharePoint Calendar. It provides you with powerful capabilities for more convenient events calendaring, e.g.:

Integrate events from different data sources into one single calendar (from SharePoint Lists, SQL Tables and Microsoft Exchange 2013, 2010 and 2007 Calendars)

Add, delete and edit events with drag & drop feature

Multi-level color coding - You can add color legend to remember which colors refer to your events. Event coloring according to event data source, according to event type,

Day, Year, Month, Week, Work Week, Task (Days), Task (Hours) views

Audience Targeting Support

Advanced filtering, displaying only items satisfied to the specific criteria

Print any Calendar View

Adding Event with a single click

Event Coloring according to List Type

Date Picker for quick and easy navigation

Event duration editing with a simple resizing action

Event date changing with a just drag and drop

Single aggregated view of all your events from different SharePoint Lists not only single SharePoint Site

Conclusion:

Virto SharePoint Calendar enables SharePoint users to plan their activities in a fastest way. The functionality and features of the calendar helps to save the time for real business instead of dying under events and other activities.

Virto SharePoint Calendar Web Part is user friendly and has a simple interface,
allowing users to easily create new calendar events with a single click!
Included with Virto are editing features that will make working with
SharePoint easy and pleasant. You can download it a free 30-days trial at: Virto SharePoint Calendar Web Part

Also, VirtoSoftware releases in the next month a new SharePoint Calendar app for Office 365. Useful options and great quality on the new platform! Find the latest news on www.virtosoftware.com

Problem:
SharePoint 2010 people search gives "Domain\AccountID" instead of Display name of the user!

Solution:
SharePoint uses "Preferred Name" property which is mapped with "Display Name" property from AD in People search results. Here, I found the root cause of the problem as: User profile not in sync!
Steps to resolve:

Make sure in AD, display name field is set properly

Go to SharePoint central Administration >> Do a full profile import.

Once you run full profile import, You should see the display name field updated in user profiles.

Run SharePoint search incremental crawl once for the search results to get updated.

This script produces a CSV file with all List Name, their URLs and number of lookup columns where the list exceeds maximum count configured in web application throttling settings in SharePoint 2013 central administration site.

Monday, July 27, 2015

There are occasions when you may need to attach or detach a content database to SharePoint web applications. E.g. during migrations you want to restore a content database from another farm and would like to access the sites in the content database from a new web application.You can attach or detach SharePoint 2016 content databases by using Central Administration or PowerShell.

As stsadm is deprecated in SharePoint 2013, We should use below PowerShell cmdlets to to attach-detach content databases in SharePoint:

Mount-SPContentDatabase
The Mount-SPContentDatabase cmdlet attaches an existing content
database to the specified Web application in the SharePoint farm. If the database
being mounted requires an upgrade, this cmdlet upgrades the database
automatically. We use this cmdlet when:

During Migrations when you want to attach (or associate) the content database with new build (or new platform). E.g. Database attach upgrade

Move a content database from one database server to another, E.g. You got the database backup of a SharePoint site from your client and want to use that database in your environment

When we attach a content database to a different web application.

Important: Before using Mount-SPContentDatabase, make sure you restored the database to your SharePoint Database Server (SQL Server) first!

This PowerShell command attaches content database "SP2010_Intranet_Content" to the SharePoint 2013 web application "http://migration.crescent.com". By default, Mount-SPContentDatabase cmdlet upgrades the schema of the database to the destination build and upgrades all site collections within the specified content database, if required!

Dismount-SPContentDatabaseDismount-SPContentDatabase is the reverse of Mount-SPContentDatabase. It detaches the given content database from the specified web application. This cmdlet just updates the mapping between web application and content database but doesn't actually delete the database from SQL server.

Dismount-SPContentDatabase syntax to detach content database:

Dismount-SPContentDatabase -Name "Content-database-name"

E.g. Here is how to detach content database in SharePoint 2010

Dismount-SPContentDatabase -Name "SP2010_Intranet_Content"

This PowerShell cmdlet removes content database from SharePoint .

If you still want to use STSADM to detach content database in SharePoint, use:
stsadm -o deletecontentdb -url http://SharePoint.company.com -databasename <MOSS2007_Migration_Content>

Apply composed look programmatically in SharePoint 2013
If you want to uniformly apply the composed look which comprises of Master Page, Image file, Font schema to all sites, you can utilize PowerShell.

Visio diagrams are wonderful way to express ideas, simplify complex topologies, illustrate the process flow, etc. With Visio Services in SharePoint 2013, you can publish Visio diagrams in SharePoint so that they can be Shared and viewed online without installing Visio application in client computers.

To confirm everything is up and running, Go to the "Services on Server" page in the SharePoint 2013 Central Administration and make sure "Visio Graphics Service" is marked as started and under Service Applications list "Visio Graphics Service Application" is listed.

Grant permissions to Visio Service account on All web applications
Make sure the service account you used for visio graphics service application is granted with dbo access to all content databases of all web applications in order to render visio web drawing.

Thursday, July 16, 2015

Audit log feature in SharePoint helps us to analyze how SharePoint contents are being used by users or to track documents and users in accordance to compliance requirements.
SharePoint 2013 audit log configuration is explained in my another post: Configuring Audit Logs Feature in SharePoint 2013 . Lets see how to enable auditing feature in SharePoint 2013 using PowerShell.

PowerShell to set SharePoint 2013 Audit Log Settings

To set SharePoint 2013 site collection audit settings using PowerShell, use this script:

Wednesday, July 15, 2015

Solution:
SharePoint Alert objects have "Status" property which can be turned ON or OFF. As there is no UI to disable or enable alerts in SharePoint directly from the browser, we can do it programmatically with PowerShell. Here is my PowerShell script to disable alerts on SharePoint 2010/2013 listor library.

Important: This script disables ONLY existing alerts in a specific list or library! It doesn't (of course, can't!) disable any new alerts you create on the particular list! You may have to temporarily turn-off alerts on web application level by changing the flag "AlertsEnabled" to "false" as in How to Disable Alerts in SharePoint

Tips: How to find and restore all items deleted by a particular use? Use: $RecycleBin | Where { $_.DeletedBy -like "Domain\Account" }

Restore based on Object Type (such as List, Web, ListItem, etc)
What if you want to restore all deleted lists or deleted sub-sites from the Recycle bin? Here is the PowerShell script to restore all deleted lists from SharePoint 2013 recycle bin.

Delete all user profiles in SharePoint
In an another scenario, I got a requirement of cleaning up user profile store. Although many profiles exists in user profile store, they were not shown in SharePoint 2013 Central administration. So, Deleting orphan/corrupted user profiles from Central administration is not possible. To remove all user profiles, use this PowerShell script:

Thursday, July 2, 2015

Requirement: Found a SharePoint Site collection growing in size over a period of time and wanted to move the SharePoint 2013 site collection to another content database.

Solution: Use the PowerShell Cmdlet Move-SPSite to move site collection from one content database to another. Here is how: First, Identify the target content database to move your site collection. You can create new content database with New-SPContentDatabase cmdlet. Next, Run Move-SPSite cmdlet with site collection URL and database name parameters.

What is JsLink in SharePoint 2013:
JSLink is a new method of combining JavaScript, CSS and HTML elements together to customize the look and feel of SharePoint Fields, List Items, List views, List forms and web parts.How to use JSLink in SharePoint 2013?
Here is the SharePoint 2013-jslink example. Lets customize the look and feel of static "% Complete" to bar chart with the help of JSLink. At high-level, here are the steps:

Create a JavaScript override file

Upload the JavaScript file to the "Master Page Gallery >> Display Templates", Set the content type and properties of the file.

Set the JS Link property of the List view web part to point to the JavaScript file we've uploaded.

Step 1: Create your custom JS file to render SharePoint list field
As the first step, We'll have to create a new js file which customizes the rendering of our field. Here is what I've created "TaskListDT.js".

While uploading, Make sure you set
the properties of the JS file. Set the content type as "JavaScript Display Template" and supply other required parameter values as in the below screen.

Step 3: Set JS Link property of List View Web part in SharePoint 2013
The next step is to specify the location of your JavaScript file in the List view web part property. Be sure you follow the "~sitecollection/Your-JS-File-complete-Path" format! (Can also use: ~site, ~layouts, ~siteLayouts, ~siteCollectionLayouts tokens)