Friday, August 07, 2015

Convert Word documents to PDF in bulk using SharePoint 2013 Word Automation Services - PowerShell Script


Find below the PowerShell script to save PDF version of Word documents in a SharePoint 2013 document library. Take note of the input parameters and corresponding value in the script below, so that you can set your own value for this script to run properly


# Uncomment the line below if running this script within Windows PowerShell ISE
#Add-PSSnapin Microsoft.SharePoint.PowerShell

# Input parameters for the script
# Input the SharePoint list Name - replace Shared Documents with your Document Library Name
$listUrl="Shared Documents"

# Get the Word Automation Service Proxy
$wasp = Get-SPServiceApplicationProxy | where { $_.TypeName -eq "Word Automation Services Proxy" }

#Create the Conversion job
$conversionJob = New-Object Microsoft.Office.Word.Server.Conversions.ConversionJob($wasp)

# Get the web url
# Input the SharePoint URL - replace sharepoint.test.com with your sharepoint site url
$web = Get-SPWeb "http://sharepoint.test.com/"

# Set the credentials to use when running the conversion job.
$conversionJob.UserToken = $web.CurrentUser.UserToken

# Conversion Job Name
$conversionJob.Name = "ConvertDOCXtoPDF1"
$conversionJob.Settings.OutputFormat = [Microsoft.Office.Word.Server.Conversions.SaveFormat]::PDF
$conversionJob.Settings.UpdateFields = $true
$conversionJob.Settings.OutputSaveBehavior = [Microsoft.Office.Word.Server.Conversions.SaveBehavior]::AlwaysOverwrite

#Get list
$list = $web.Lists[$listUrl]

# Replace the variable "SubFolderName" with your own folder name or remove SubFolders[..] if querying all files in root folder
foreach ($itm in $list.RootFolder.SubFolders["SubFolderName"].Files){
    # Replace .docx with .doc or other Word file extensions depending on the Word formats you are trying to convert
    if($itm.Name.ToLower().EndsWith(".docx") -eq $true) {
        Write-Host $($itm.ServerRelativeUrl)
        # Note the job below will convert all Word files to PDF and save it into the same location as where source Word document are. Modify code below to save to alternate location
        $conversionJob.AddFile($($web.Site.MakeFullUrl($itm.ServerRelativeUrl)), $($web.Site.MakeFullUrl($itm.ServerRelativeUrl).ToLower().Replace(".docx", ".pdf")))
               
    }
}
# Start the conversion job
$conversionJob.Start()

Saturday, June 06, 2015

Create a shortcut link to the "New Document" ribbon menu item to create a new document from a document template

The ribbon in SharePoint 2013 is useful but not user friendly if one is looking to create a document based on a pre-defined document template that is associated with a content type. Find below the code snippet that can be used to add a custom JQuery button or override existing script on button(s) to easily open a document based on a pre-defined Word template that is associated with the document library or content type:

Primary function

// Ensure that you replace the siteURL, docTemplateURL and docLibraryURL with your own values
// e.g. siteURL = http://intranet/
// e.g. docTemplateURL = http://intranet/doc%20ibrary/forms/template.docx
// e.g. docLibraryURL = http://intranet/doc%20ibrary
function createNewDocumentInstance(siteURL, docTemplateURL, docLibraryURL){

  var createDocumentURL = siteURL + "/_layouts/CreateNewDocument.aspx?id=" + docTemplateURL;

  // Invoke the internal SharePoint function to create a new document based on the document template
  createNewDocumentWithRedirect2(event, docTemplateURL, docLibraryURL, 'SharePoint.OpenDocuments', false, createDocumentURL, true, 0);

}

Possible Use (EXAMPLE Only)

function replaceAnchorTagOnClickEventAndHref(aTag, siteURL, docTemplateURL, docLibraryURL)
{
  aTag.click(function() {
   // Handle home page hyperlink update to open new document instance based on content type
    createNewDocumentInstance(siteURL, docTemplateURL, docLibraryURL);
    return false;
  }); // End onclick event for aTag to open document in New Window
 
  aTag.attr("href", "#");
}
$(document).ready(function() {

  // Find the anchor tag that needs to be set with the onclick event
  // e.g. if the anchor text is set to 'My New Document Hyperlink'
  var aTag = $(".link-item a:contains('My New Document Hyperlink')");

  if (aTag.length > 0) {
    replaceAnchorTagOnClickEventAndHref(aTag,
               "http://intranet/",
             "http://intranet/MyDocLibrary/Forms/TestContentType/TestContentTypeTemplate.docx",
            "http://intranet/MyDocLibrary/");
}

Thursday, March 12, 2015

How to configure Yammer or a specific Yammer group to accept the post updated via email right away without sending back a confirmation email to the sender?


You can configure it through the admin control panel in Yammer.

Admin > Design and Configuration > below Email Settings, uncheck ''Require all users in your network to confirm their posts made by email before posting'' > then Save.

 

Thursday, March 05, 2015

How to implement your custom breadcrumb navigation in SharePoint 2013


You can easily add breadcrumb navigation to your SharePoint 2013 pages by including the following tag (and setting the associated properties) called "SharePoint:ListSiteMapPath" in your master page. Please note that "SharePoint:ListSiteMapPath" has property “SiteMapProviders” which means we can specify more than one  provider object with one ListSiteMapPath control
 
Add following code snippet to your Master Page content place holder (you can chose any one depending on where you want to position the breadcrumb navigation on the page), for e.g. you can add to "PlaceHolderPageTitleInTitleArea"
 
<SharePoint:ListSiteMapPath

                runat="server"

                SiteMapProviders="SPSiteMapProvider,SPContentMapProvider"

                RenderCurrentNodeAsLink="false"

                CssClass="my-breadcrumb"

                NodeStyle-CssClass="my-breadcrumbLink"

                CurrentNodeStyle-CssClass="my-breadcrumbLinkCurrent"

                RootNodeStyle-CssClass="my-breadcrumbLinkRoot"   

                HideInteriorRootNodes="true"

                SkipLinkText=""

                PathSeparator="" />
 
Please note that you have to define your own stylesheets to implement the class "my-breadcrumb", "my-breadcrumbLink", "my-breadcrumbLinkCurrent" and "my-breadcrumbLinkRoot"

Thursday, February 12, 2015

How to resolve "Access is denied to the Secure Store Service." error in SharePoint 2013


You configure BCS and Secure Store Service correctly and then when trying to access the External list items, you may encounter a very strange error that reads something like this:
 
Unable to render the data. If the problem persists, contact your web server administrator.


Correlation ID:<some guid>

When you check your SharePoint error logs, you may notice some errors like this:

Secure Store Service ValidateCredentialClaims - Access Denied: Claims stored in the credentials did not match with the group claim for a group app. 

Secure Store Service           Secure Store                   GetRestrictedCredentials failed with the following exception: System.ServiceModel.FaultException`1[Microsoft.Office.SecureStoreService.Server.SecureStoreServiceFault]: Access is denied to the Secure Store Service. (Fault Detail is equal to Microsoft.Office.SecureStoreService.Server.SecureStoreServiceFault). <some guid>

The best way to resolve this issue is to check the configured Target Application ID, especially "Members - The users and groups that are mapped to the credentials defined for this Target Application." and ensure proper user or group is entered (by clicking the "Edit" option on the Target Application in under Secure Store Service Application Administration screen -  Central Admin > Application Management > Manage Service Applications > Secure Store Service and Edit the Target Application ID > Click on Next till you get to the third page and set the field "Members" with the proper users/groups who will access this External list from SharePoint - in my example I set to "All Users")


Friday, February 06, 2015

How to Remove Page Title next to the logo in SharePoint 2013

Here is a quick tip on how you can Remove Page Title next to the logo in SharePoint 2013. Add to the end of your custom stylesheet for your SharePoint 2013 theme (typically in the Style Library)

h1.ms-core-pageTitle { display: none; } /* hide page title next to the logo */

Monday, January 19, 2015

How to solve Office 365 SharePoint Online error "Sorry you're not set up to follow" when you try to Follow a Document or Site. Unfortunately, it looks like your account hasnt't been set up to follow documents or sites."


 
In Office 365, you may have encountered this strange error where it throws an error "Sorry you're not set up to follow" when you try to Follow a Document or Site. There might be more information about the above error message such as "Unfortunately, it looks like your account hasnt't been set up to follow documents or sites."
 
 
 
The way to solve this issue is to login as Office 365 Global Administrator account to SharePoint Online Administration and navigate to the following - User Profiles -> People -> Manage User Permissions and enable the following checkboxes for the group "Everyone except external users"
 
Wait for 5-10 mins and VOILA! your users will now be able to follow sites and documents.

 
 

Tuesday, October 21, 2014

Strange Error in IE Developer window "Unable to get property 'showWaitScreenWithNoClose'" when changing Page Layout in SharePoint 2013 / SharePoint Online

I encountered a very strange error on Office 365 SharePoint Online where the ability to change the Page Layout suddenly stopped working (Page Layout button was still enabled though but none of the Page Layouts were clickable).

Basically when I debugged the error using IE Developer toolbar, I saw that the error was being thrown within sp.ui.runtime.js file each time I was trying to change the Page Layout - namely "Unable to get property 'showWaitScreenWithNoClose'" and also the SP.UI.ModalDialog box was null.

Eventually I traced the error back to the order of key js files that should be included/loaded on the default master page for the site. In my case the culprit were two script references:

<script src="../../_layouts/15/SP.Runtime.js" type="text/javascript">//<![CDATA[
//]]>
</script>

<script src="../../_layouts/15/SP.js" type="text/javascript">//<![CDATA[
//]]>
</script>

I changed the above lines in the default master page to:

<!--SPM:<Sharepoint:ScriptLink runat="server" Name="SP.js" Localizable="false"  ID="s1" LoadAfterUI="true"/>-->

<!--SPM:<Sharepoint:ScriptLink runat="server" Name="SP.Runtime.js" Localizable="false"  ID="s2" LoadAfterUI="true"/>-->
 
The key thing to note is the "LoadAfterUI" attribute that seemed to do the trick,
 
Now my page layouts are selectable and I can click and change the Page Layout to one the available layout pages in my site collection (Note - ensure that the page is in Edit mode for you to change the Layout Page)
 

Friday, September 26, 2014

/_layouts/15/osssearchresults.aspx not returning any search results when Searching "This Site"

I have commonly observed this issue being researched on a few times where a user selects "This Site" from Search scope/nvaigation dropdown and tries to search for a specific content in the current site, the "No results found" message is displayed. The proble is not with crawling or Search configuration but is with "Alternate Access Mappings" (AAM).

To fix the above issue and see results when searching "This Site" ensure that you have set the URL  for default zone same as URL that you are using to access the site using your browser. For example if you are using https://intranet.mycompany.com as URL to access your Intranet using a browser then ensure that the above URL is set in Alternate access mapping as your Default Zone (refer to <your SharePoint central admin URL>/_admin/EditOutboundUrls.aspx)

Thursday, August 08, 2013

How to Lookup error in SharePoint 2010 by Correlation ID

If you have seen an Unknown Error message popup window in SharePoint 2010 and it looks something like below, you may wonder how can I easily find out what the error is using the big clumsy GUID.

The answer you seek is in SharePoint 2010 Power Shell Window. On the SharePoint Web Server, Click on Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell

Now use the following powershell command:
get-splogevent | ?{$_.Correlation -eq "<enter the error GUID here>"} | select Area, Category, Level, EventID, Message | Format-List

Friday, July 26, 2013

How to resolve error when upgrading SharePoint Standard 2010 to Enterprise - "An error occurred while enabling Enterprise features. Refer to the event logs on your server machines for more details. For more information on how to fix this error"

If you are trying to upgrade SharePoint Standard 2010 to Enterprise version via inputting the licence key in Central Admin and getting the following error:
""
then follow the steps below to resolve this issue:

1) On the SharePoint Web Server, Launch Services (Go to Start > Search Programs and Files... and type "Services" and press Enter key)

2) On "Services" window scroll down to "SharePoint 2010 Timer" and check which account is running that services. It is probably one of your Farm Administrator account. If not then note down this account name and then Open up "Central Admin > Security > Manage the farm administrators group" and Add the above account to Farm administrators group

3) Now go back to the Services Window, Right Click on the "SharePoint 2010 Timer" service and select "Restart"

4) Open Central Admin > Upgrade and Migration > Enable Enterprise Features (e.g. http://<your central admin url>/_admin/SkuUpgrade.aspx). Enter a Valid license key and click on OK

5) Once SharePoint 2010 Enterprise version upgrade is completed successfully, Restart IIS (iisreset \noforce)

6) Enable Enterprise Features on your existing Sites (http://<your central admin url>/_admin/enablefeatures.aspx)

7) Remove the "SharePoint 2010 Timer" account from Farm administrators group if it was added just for the upgrade process

Wednesday, June 12, 2013

Is SharePoint 2013 Worth the Upgrade? Here is our TOP 6 features that compell you to upgrade. Share more if you have like our post

SharePoint 2013 is packed with a lot of bells and whistles as compared to its predecessor SharePoint 2010. But the features that really stands out are:

1) Device Channels - Design a Layout, Look and Feel specific to iPhone, Windows Phone, Surface and iPad
2) Cross Browser Compatibility (incl. mobile browser) - Full support for HTML5, CSS3, JQuery and all the good stuff

3) "One Search" Solution (no confusing FAST vs Enterprise Search) - Our Favorite feature especially the new “Continuous Crawl” option that will allow users to search all the time and trust the results. Also the new "Content Search Web Part" ROCKS!

4) Social Media and Gamification - Use Community Sites and Portal to promote discussion between site members and assign badges/points to members who answer questions

5) Design "Responsive" Websites - Friendly URLs, Design Manager (clear seperation of code from design), Device Channels (ability to target same content rendered differently on different mobile devices), Managed Navigation, Content Search Web Part etc all adds to the a simple yet enhanced web design and development user experience

6) SharePoint Apps and App Store - Build cool apps and add-ons for SharePoint and allow users to install "1-click install" apps similar to Google Play or Apple iTunes Store.

Tuesday, June 04, 2013

How to Left align some text and Right align some other text ON THE SAME LINE

Here is a neat trick I learned recently on how to Left align some sample text (say "Hello Ragav")  and Right align some different text (say "www.klstinc.com") on the same line, so that the final look is something like below


Hello Ragav                                                                                                                 www.klstinc.com


Step 1: For the left align text use a <p>, <div> tag with style attribute value set "float:left". For example - <div style="float:left">Hello Ragav</div>

Step 2: For the right align text use a <p>, <div> tag with style attribute value set "float:right". For example - <div style="float:right">www.klstinc.com</div>

Step 3Clear your float by adding the line below <div style="clear: both;"></div>

In Summary, to implement the above left and right aligned text in same line the final HTML block should look something like below:

<div style="float:left">Hello Ragav</div>
<div style="float:right">www.klstinc.com</div>
<div style="clear: both;"></div>
 
 

Saturday, May 11, 2013

Comparison cheatsheet for SharePoint 2013 Foundation vs. SharePoint 2013 Standard vs. SharePoint 2013 Enterprise

Find below a table that outlines the various features included in the different versions of SharePoint 2013 (Foundation vs. Standard vs. Enterprise)
Foundation Standard Edition Enterprise Edition
Developer features
Access Services No No Yes
App Catalog (SharePoint) No Yes Yes
App Deployment: Autohosted Apps No No No
App Deployment: Cloud-Hosted Apps No Yes Yes
App Deployment: SharePoint-Hosted Apps No Yes Yes
App Management Services No Yes Yes
BCS: Alerts for External Lists No Yes Yes
BCS: App Scoped External Content Types (ECTs) No Yes Yes
BCS: Business Data Webparts No Yes Yes
BCS: External List Yes Yes Yes
BCS: OData connector No Yes Yes
BCS: Profile Pages No Yes Yes
BCS: Rich Client Integration No No Yes
BCS: Secure Store Service Yes Yes Yes
BCS: Tenant-level external data log No No Yes
Browser-based customizations Yes Yes Yes
Client Object Model (OM) Yes Yes Yes
Client-side rendering (CSR) Yes Yes Yes
Custom Site Definitions No No Yes
Custom Site Provisioning No No Yes
Developer Site No No No
Forms Based Applications No Yes Yes
Forms on Spreadsheets No Yes Yes
Full-Trust Solutions Yes Yes Yes
InfoPath Forms Services No No Yes
JavaScript Object Model Yes Yes Yes
List and Library APIs Yes Yes Yes
Remote Event Receiver Yes Yes Yes
REST API Yes Yes Yes
Sandboxed Solutions Yes Yes Yes
SharePoint Design Manager Yes Yes Yes
SharePoint Designer Yes Yes Yes
SharePoint Store Yes Yes Yes
Workflow 2010 (.NET 3.5) Yes Yes Yes
Workflow 2010 (out of the box) No Yes Yes
Workflow 2013 No Yes Yes
Workload API: ECM APIs No Yes Yes
Workload API: Search APIs Yes Yes Yes
Workload API: Social APIs No Yes Yes
IT Professional features
Active Directory Synchronization Yes Yes Yes
Alternate Access Mapping (AAM) Yes Yes Yes
Analytics Platform No No Yes
Claims-Based Authentication Support Yes Yes Yes
Configuration Wizards No Yes Yes
Deferred Site Collection upgrade Yes Yes Yes
Distributed Cache Yes Yes Yes
Host Header Site Collections Yes Yes Yes
Improved Permissions Management Yes Yes Yes
Improved Self-Service Site Creation No No Yes
Managed Accounts Yes Yes Yes
Minimal Download Strategy (MDS) Yes Yes Yes
OAuth No Yes Yes
Patch Management Yes Yes Yes
Quota Templates Yes Yes Yes
Read-Only Database Support Yes Yes Yes
Remote Blog Storage Yes Yes Yes
Request Management Yes Yes Yes
Request throttling Yes Yes Yes
Resource throttling Yes Yes Yes
Service Application Platform Yes Yes Yes
SharePoint Health Analyzer Yes Yes Yes
SharePoint Online Admin Center N/A (SharePoint Online only) N/A (SharePoint Online only) N/A (SharePoint Online only)
Shredded Storage Yes Yes Yes
Site Collection Compliance Policies No Yes Yes
Site Collection Health Checks Yes Yes Yes
State Service Yes Yes Yes
Streamlined Central Administration Yes Yes Yes
System Status Notifications Yes Yes Yes
Unattached Content Database Recovery Yes Yes Yes
Upgrade evaluation site collections Yes Yes Yes
Usage Reporting and Logging Yes Yes Yes
Windows PowerShell Support Yes Yes Yes
Content features
Accessibility Standards Support Yes Yes Yes
Asset Library Enhancements/Video Support Yes Yes Yes
Auditing No Yes Yes
Auditing & Reporting (e.g. doc edits, policy edits, deletes) No Yes Yes
Auditing of View Events No Yes Yes
Content Organizer No Yes Yes
Design Manager Yes Yes Yes
Document Sets No Yes Yes
Document Translation in Word Web App Yes Yes Yes
eDiscovery No No Yes
External Sharing: External Access No No No
External Sharing: Guest Link No No No
Folder Sync No Yes Yes
Information Rights Management (IRM) No Yes Yes
In-Place Hold Yes Yes Yes
Managed Metadata Service No Yes Yes
Metadata-driven Navigation No Yes Yes
Multi-stage Disposition No Yes Yes
Office ProPlus (Osub) No No No
Office Web Apps (edit) Yes Yes Yes
Office Web Apps (view) Yes Yes Yes
Office Web Apps Server integration Yes Yes Yes
PowerPoint Automation Services No Yes Yes
Preservation hold library No No Yes
Quick Edit Yes Yes Yes
Related Items Yes Yes Yes
Rich Media Management No Yes Yes
Shared Content Types No Yes Yes
SharePoint Translation Services No Yes Yes
Site mailbox No Yes Yes
Unique Document IDs No Yes Yes
Video Search No No Yes
WCM: Analytics No Yes Yes
WCM: Catalog No No Yes
WCM: Cross-site publishing No No Yes
WCM: Designer Tools No Yes Yes
WCM: Faceted navigation No No Yes
WCM: Image Renditions No No Yes
WCM: Mobile and Device Rendering No Yes Yes
WCM: Multiple Domains No No Yes
WCM: OOTB Recommendations Webparts No Yes Yes
WCM: Search Engine Optimizations (SEO) No Yes Yes
WCM: Topic Pages No No Yes
Word Automation Services No Yes Yes
Insights features
Business Intelligence Center No No Yes
Calculated Measures and Members No No Yes
Data Connection Library No No Yes
Decoupled PivotTables and PivotCharts No No Yes
Excel Services No No Yes
Field list and Field Support No No Yes
Filter Enhancements No No Yes
Filter Search No No Yes
PerformancePoint Services No No Yes
PerformancePoint Services (PPS) Dashboard Migration No No Yes
Power View No No Yes
PowerPivot No No Yes
Quick Explore No No Yes
Scorecards & Dashboards No No Yes
SQL Server Reporting Services (SSRS) Integrated Mode No No Yes
SQL Server Reporting Services (SSRS) Integrated Mode No No Yes
Timeline Slicer No No Yes
Visio Services No No Yes
Search features
Advanced Content Processing Yes Yes Yes
Content Search Web Part No No Yes
Continuous crawl Yes Yes Yes
Custom entity extraction No No Yes
Deep links No Yes Yes
Event-based relevancy No Yes Yes
Expertise Search Yes Yes Yes
Extensible content processing No No Yes
Graphical refiners No Yes Yes
Hybrid search Yes Yes Yes
Managed navigation No Yes Yes
On-premises search index N/A (SharePoint Online only) N/A (SharePoint Online only) N/A (SharePoint Online only)
Phonetic name matching Yes Yes Yes
Query rules—Add promoted results No Yes Yes
Query rules—advanced actions No No Yes
Query spelling correction Yes Yes Yes
Query suggestions No Yes Yes
Query throttling No Yes Yes
Quick preview Yes Yes Yes
Recommendations No Yes Yes
Refiners Yes Yes Yes
RESTful Query API/Query OM Yes Yes Yes
Result sources Yes Yes Yes
Search connector framework No No No
Search results sorting Yes Yes Yes
Search vertical: “Conversations” No Yes Yes
Search vertical: “People” No Yes Yes
Search vertical: “Video” No No Yes
Tunable Relevancy No No No
Sites features
Change the look Yes Yes Yes
Connections to Microsoft Office Clients Yes Yes Yes
Cross Browser Support Yes Yes Yes
Custom Managed Paths Yes Yes Yes
Governance Yes Yes Yes
Large List Scalability and Management Yes Yes Yes
Mobile Connectivity Yes Yes Yes
Multi-Lingual User Interface Yes Yes Yes
My Tasks Yes Yes Yes
OOTB Web Parts Yes Yes Yes
Permissions Management Yes Yes Yes
Project functionality for team sites Yes Yes Yes
Project site template Yes Yes Yes
Project Summary web part Yes Yes Yes
Project workspace Yes Yes Yes
Public Website (SPO) N/A (SharePoint Online only) N/A (SharePoint Online only) N/A (SharePoint Online only)
SharePoint Lists Yes Yes Yes
SharePoint Ribbon Yes Yes Yes
Task list Yes Yes Yes
Team Site: Drag & Drop Yes Yes Yes
Team Site: Notebook Yes Yes Yes
Team Site: Simplified Access Yes Yes Yes
Templates Yes Yes Yes
Themes Yes Yes Yes
Work Management Service Yes Yes Yes
Usage Analytics Yes Yes Yes
Social features
Ask Me About No Yes Yes
Blogs Yes Yes Yes
Communities Reputation, Badging, and Moderation No Yes Yes
Community Yes Yes Yes
Company Feed Yes Yes Yes
Follow No Yes Yes
Microblogging No Yes Yes
Newsfeed No Yes Yes
One Click Sharing No Yes Yes
People, Sites, Document Recommendations No Yes Yes
Personal Site No Yes Yes
Photos and Presence Yes Yes Yes
Profile No Yes Yes
Ratings No Yes Yes
Site Feed Yes Yes Yes
Skydrive Pro Yes Yes Yes
Tag profiles No Yes Yes
Tasks integrated with Outlook No Yes No
Trending Tags No Yes Yes
Wikis Yes Yes Yes