Friday, December 30, 2016

SharePoint 2013 Search Provisioning

SharePoint 2013 Search Provisioning

 
 SharePoint 2013 Search Overview



In SharePoint 2013, there are numerous components in Search Topology:
  • Search Admin Component
  • Index
  • Crawler
  • Content Processor
  • Analytics Processor
  • Query Processor





Enterprise Search Life Cycle

Content Processing




Analytics Processing

Planning and Deployment


Farm Configuration Wizard - Pros/Cons


Central Provisioning  - Pros/Cons


PowerShell Provisioning  - Pros/Cons



Thursday, December 29, 2016

Crawled Propeties Name in SharePoint 2013


Crawled Properties Name in SharePoint 2013


SharePoint List Column : ows_ColumnName

SharePoint Site Columns : ows_q_<4 letter code>_ColumnName

Managed Metadata : ows_taxId_ColumnName

HTML or Multiline Test : ows_r_<four letter code>_ColumnName

Profile Properties : People:InternalName

BCS properties: Entity_FieldName


Automatically Created Managed Properties


Wednesday, November 2, 2016

Delete a SharePoint 2013 Subsite

Delete a SharePoint Subsite
  1. In your web browser, open your SharePoint site.
  2. Navigate to the subsite you want to delete.
  3. Click the Settings button (Gear icon), and then click Site settings.
  4. Under Site Actions, click the Delete this site link. Click to view larger image. ...
  5. Click Delete to confirm the deletion.

Wednesday, October 12, 2016

Office Web App in SharePoint 2013

Document Preview in SP 2013
View in browser
Office Web App Server Overview
Office Web Apps Server is a new Office server product that delivers browser-based versions of Word, PowerPoint, Excel, and OneNote. A single Office Web Apps Server farm can support users who access Office files through SharePoint 2013, Lync Server 2013, Exchange Server 2013, shared folders, and websites.
Office Web Apps (OWA) is no longer a set of SharePoint Service Applications, and the deployment of a separate OWA farm is necessary.



General Guidelines
  • To minimize the complexity of the deployment, install all office web apps roles on each server instead of distributing the roles on servers.
  • Office web Apps 2013 does not require SQL database.
  • PowerShell is used to define Office Web Apps topology, by using New-OfficeWebAppsFarm command with the master server (the first server in the farm) and by using New-OfficeWebAppsMachine command to join more machines to the farm.
  • Also PowerShell commands are used to connect the SharePoint farm to Office Web Apps farm.
  • In case of installing updates and patches , the Office Web Apps server should be disconnected from the Office Web Apps farm then joined again after finish the patching.
  • SharePoint system account cant render office web apps (by design for security)
  • NLB Tips
    • Consider using NLB for high availability
    • Make sure to enable NLB server affinity
Prerequisites

Best Practice(s)
 Servers that run Office Web Apps Server must not run any other server application. This includes Exchange Server, SharePoint Server, Lync Server, and SQL Server. If you have hardware constraints, you can run Office Web Apps Server in a virtual machine instance on one of these servers.
  • Don’t install any other server applications on the server that’s running Office Web Apps Server
  • Do not install any services or roles that depend on the Web Server (IIS) role on port 80, 443, or 809 because Office Web Apps Server periodically removes web applications on these ports
  • Do not install any version of Office. You must uninstall Office before you install Office Web Apps Server.
  • Don’t install Office Web Apps Server on a domain controller.
  • Make sure all SharePoint 2013 web applications use claims-based authentication. Office Web Apps rendering and editing won’t work on SharePoint 2013 web applications that use classic mode authentication

Next Steps after installation
After installation, we need to run following cmdlets to create OWA Farm.
  • New-OfficeWebAppsFarm –InternalUrl “http://OfficeApps” –AllowHttp –EditingEnabled – To create new OWA Farm
  • New-OfficeWebAppsHost -Domain  - To Add your domain to the list of allowed hosts.
  • New-SPWOPIBinding -ServerName <WacServerName> -AllowHTTP    -  Configure a connnection between SP Farm and OWA Farm
  • Set-SPWopiZone –zone "internal-http"   – To set the zone
  • Set-OfficeWebAppsFarm –EditingEnabled – Enabling Edit in Browser
  • Change the AllowOAuthOverHttp setting in SharePoint 2013 to True
  •  
Limitations:
1.       Only Supports Microsoft office Documents (Microsoft Office Word, Excel, PowerPoint, or OneNote document).
2.       In order to enable this preview functionality, you must have a separate Farm. ( Extra Server(s))
3.       Not very lightweight as every document to be converted for each preview.
You installed the March CU for Office Web Apps 2013 (WAC) which supports rendering PDF files
File previews in SharePoint 2013 are handled by the script filepreview.js, and this script has not yet been updated to handle PDF files. You could either edit the file manually, which we know we should stay clear of, or add the following script snippet somewhere to be loaded on your page.
?



SP.SOD.executeFunc('filePreview.js', null, function () {
    embeddedWACPreview.dimensions["pdf"] = embeddedWACPreview.dimensions["docx"] ;
    filePreviewManager.previewers.extensionToPreviewerMap["pdf"] = filePreviewManager.previewers.extensionToPreviewerMap["docx"] ;
} );

What the script does is copy the registrations for Word document previews, and attaching it to the PDF file extension. Good places to add this would be your master page, a script file always included on all pages or similar.
Planning of OWA Server

Prepare servers to run Office Web Apps Server

 


Hardware Requirement
Office Web Apps Server uses the same minimum hardware requirements as SharePoint Server 2013. You can find the full set of SharePoint 2013 requirements



Downloads, Server Roles and Features for OWA Server


Add more Office Web Apps servers to the farm

All what you have to do now for any additional office web server is to:
  • Install Office Web Apps pre requisites
  • Install office web apps
  • Join the new server to the NLB Cluster (as described above)
  • Run the following windows power shell command from a machine that is already part of the farm
  • Firewall: If the machine joining the WAC farm cannot access the HTTP 809 channel the New-OfficeWebAppsMachine will throw a “The destination is unreachable error”.
New-OfficeWebAppsMachine –MachineToJoin ServerName
ServerName: is the name of the master machine (the first machine you added to the farm)
use the below command to make sure the new server is added to the farm
Get-officeWebAppsFarm

Remove Office Web Machine Server

On the server you want to remove run the below command:
Remove-OfficeWebAppsMachine
Tip: If, for any reason, you want to disconnect SharePoint 2013 from Office Web Apps Server, use the following command example:
Remove-SPWOPIBinding –All:$true


More Useful Links

Thursday, June 23, 2016

How to exclude all files within folders in Document Library through SharePoint Object model

While working on one of the requirement in my project , I need to show the files in Root Folder of Document library only not from child folders within it.

Through "Folder" option in default view, I can only set to show the folder or show files without folder.

But through code we will get all the files in root folder as well as in child folder also.

To resolve this, you need to use Scope="FilesOnly" for the ViewAttributes property of the SPQuery.

 SPList list = _oWeb.Lists["Library Name"];
 SPQuery spQuery = new SPQuery();
 spQuery.ViewAttributes = "Scope=\"FilesOnly\"";
 SPListItemCollection items = list.GetItems(spQuery);

Activate hyperlink on a custom column in document library/list in Default View


You can do it by setting LinkToItem="True" attribute in the default view for list or document library.

You can use SharePoint Designer for this, open your list or library and then your view and make change like shown below:

<ViewFields>
     <FieldRef Name="DocIcon"/>
     <FieldRef Name="LinkFilename"/>
     <FieldRef Name="Modified"/>
     <FieldRef Name="Editor"/>
     <FieldRef Name="FileSizeDisplay"/>
     <FieldRef Name="CustomLink" LinkToItem="TRUE"/>
</ViewFields>


If you want to set any specific URL, then you can create a "calculated column" by using a formula with existing column and use this new calculated column in above example.

=CONCATENATE("http://YourDomain/sites/SiteCollection/Lists/ListName/Forms/<<any form name>>.aspx?ID=",ID)

Thursday, May 19, 2016

Memory leakage check in MOSS 2007 and SharePoint 2010

SPDisposeCheck Utility for MOSS 2007 and SharePoint 2010

How to Install
 
1. Double Click on "SPDisposeCheck.msi" file to install the utility. Click "Next" to install on default location.
 
2. Open "Command Prompt" in admin mode and navigate to the folder where it got installed.
 
 
3. Run this command (sample)

C:\Program Files (x86)\Microsoft\SharePoint Dispose Check>SPDisposeCheck C:\DEVE
LOPMENT\MRK.Extension\MRK.Webparts.Extension\bin\Release\MRK.Webparts.Extension.
dll -xml C:\Upload\output1.xml




4. You can navigate to location which you have mentioned for output path. Open the above mentioned xml file.

 
 

For SharePoint 2013, please refer below link.
https://social.msdn.microsoft.com/Forums/sharepoint/en-US/2a3811c6-72d7-4948-ae34-dd7cf5bca099/sharepoint-dispose-checker-tool-and-sharepoint-2013?forum=sharepointdevelopment

https://www.spcaf.com/blog/stop-using-spdisposecheck-or-msocaf-with-sharepoint-2013-now/

Friday, March 4, 2016

SharePoint : Internal Field Names for SharePoint List Columns


TitleInternalName
$Resources:RulesUrl
$Resources:XomlUrl
% Complete
About Me
Account
Action
Actual Work
Address
All Day Event
Allow writers to view cached content
Anniversary
Append-Only Comments
Approval Status
Approver Comments
Article Date
Assigned To
Assistant’s Name
Assistant’s Phone
Associated Content Type
Associated Service
Attachments
Author
Automatic Update
Base Association Guid
Billing Information
Birthday
Body
Body
Body Was Expanded
Business Phone
Business Phone 2
Byline
Cacheability
Callback Number
Car Phone
Categories
Category
Category
Category
Check for Changes
Check In Comment
Checked out User
Children’s Names
City
Comments
Comments
Company
Company Main Phone
Company Phonetic
Completed
Computer Network Name
Connection Type
Contact
Contact E-Mail Address
Contact Name
Contact Photo
Contact Picture
Content Category
Content Type
Content Type ID
Content Type ID
Contributor
Copy Source
Correct Body To Show
Country/Region
Coverage
Created
Created
Created By
Custom ID Number
Data
Date Completed
Date Created
Date Modified
Date Occurred
Date Picture Taken
Deleted
Department
Department
Description
Description
Description
Discussion Subject
Discussion Title
Display Description
Display Name
Document Created By
Document Modified By
Due Date
Duration
Duration
Duration
Edit
Edit Menu Table End
Edit Menu Table Start
Effective Permissions Mask
E-Mail
E-mail 2
E-mail 3
Email Body
E-Mail Calendar Date Stamp
E-Mail Calendar Sequence
E-Mail Calendar UID
E-Mail Cc
E-Mail From
Email Messages
E-Mail Sender
E-Mail Subject
E-Mail To
Enabled
Encoded Absolute URL
End Date
End Time
Event Address
Event Canceled
Event Type
Event Type
Expires
Extended Properties
External Participant
External Participant Reason
Fax Number
File Size
File Size
File Type
File Type
First Name
First Name Phonetic
Form Category
Form Data
Form Description
Form ID
Form Locale
Form Name
Form Name
Form Relative Url
Form Version
Form_URN
Format
FTP Site
Full Name
FullBody
Gender
Government ID Number
Group Type
GUID
Has Copy Destinations
Has Custom Email Body
Hidden Page
Hobbies
Home Address City
Home Address Country
Home Address Postal Code
Home Address State Or Province
Home Address Street
Home Fax
Home Phone
Home Phone 2
Html File Link
HTML File Type
ID
IM Address
Image Caption
Indentation
Indentation Level
Initials
Instance ID
Is Active
Is Current Version
Is Root Post
Is Signed
Is Site Admin
ISDN
Issue ID
Issue Status
Item Type
Job Title
Keywords
Language
Last Name Phonetic
Last Printed
Last Updated
Less Link
Level
Limited Body
Link
List ID
Location
Manager’s Name
MasterSeriesItemID
Merge
Message ID
Middle Name
Migrated GUID
Mileage
Mobile Phone
Modified
Modified
Modified By
More Link
Name
Name
Name
Name
Name
Nickname
Office
Order
Order
Organizational ID Number
Other Address City
Other Address Country
Other Address Postal Code
Other Address State Or Province
Other Address Street
Other Fax
Other Phone
Outcome
Outcome
owshiddenversion
Page Content
Page Icon
Page Image
Page Layout
Pager
Parent Folder Id
Path
Pending Modification Time
Perform ACL Check
Personal Website
Picture
Picture Height
Picture Size
Picture Width
Post
Posted By
Posted By
Posting Information
Preview
Preview Image
Primary Item ID
Primary Phone
Priority
Profession
ProgId
Property Bag
Published
Publisher
Quoted Text Was Expanded
Radio Phone
Recurrence
Recurrence ID
RecurrenceData
Redirect URL
References
Referred By
Related Company
Related Issues
Relation
Relink
Replies
Reply
Required Field
Resource Identifier
Resource Type
Response
Reusable HTML
Reusable Text
Revision
Rights Management
Role
Rollup Image
Safe for Authenticated Use
Scheduling End Date
Scheduling Start Date
ScopeId
Select
Select
Selection Checkbox
Send Email Notification
Server Relative URL
Shared File Index
Shortest Thread-Index
Shortest Thread-Index Id
Shortest Thread-Index Id Lookup
Show Combine View
Show in Catalog
Show Repair View
SIP Address
Source
Source Name (Converted Document)
Source Url
Source Version (Converted Document)
Spouse
Start Date
State/Province
Status
Status
Style Definitions
Subject
Subject
Subject
Suffix
Summary Links
Summary Links 2
System Task
Target Audiences
Task Group
Task Status
Task Type
Telex
Template Id
Template Link
Thread Index
Thread Topic
Threading
Threading Controls
Thumbnail
Thumbnail URL
TimeZone
Title
Title
Title
Title
Toggle Quoted Text
Total Work
Trimmed Body
TTY-TDD Phone
Type
UDC Purpose
UI Version
UID
Unique Id
URL
URL
URL
URL Path
User Field 1
User Field 2
User Field 3
User Field 4
User ID
Variation Group ID
Variation Relationship Link
Variations
Vary by Custom Parameter
Vary by HTTP Header
Vary by Query String Parameters
Vary by User Rights
Version
Version
Virus Status
Web Image URL
Web Page
Web Preview
Wiki Content
Workflow Association ID
Workflow History Parent Instance
Workflow Instance ID
Workflow Item ID
Workflow List ID
Workflow Name
Workflow Template ID
Workflow Version
Workspace
WorkspaceUrl
XMLTZone
ZIP/Postal Code
RulesUrl
XomlUrl
PercentComplete
Notes
Name
AdminTaskAction
ActualWork
WorkAddress
fAllDayEvent
PublishingCacheAllowWriters
Anniversary
V3Comments
_ModerationStatus
_ModerationComments
ArticleStartDate
AssignedTo
AssistantsName
AssistantNumber
PublishingAssociatedContentType
Service
Attachments
_Author
AutomaticUpdate
BaseAssociationGuid
BillingInformation
Birthday
Body
MessageBody
BodyWasExpanded
WorkPhone
Business2Number
ArticleByLine
PublishingCacheability
CallbackNumber
CarNumber
Categories
_Category
Category
PostCategory
PublishingCacheCheckForChanges
_CheckinComment
CheckoutUser
ChildrensNames
WorkCity
_Comments
Comments
Company
CompanyNumber
CompanyPhonetic
Completed
ComputerNetworkName
ConnectionType
PublishingContact
PublishingContactEmail
PublishingContactName
_Photo
PublishingContactPicture
ContentCategory
ContentType
ContentTypeId
CustomContentTypeId
_Contributor
_CopySource
CorrectBodyToShow
WorkCountry
_Coverage
Created
Created_x0020_Date
Author
CustomerID
Data
DateCompleted
_DCDateCreated
_DCDateModified
Occurred
ImageCreateDate
Deleted
Department
ol_Department
AdminTaskDescription
Comment
DLC_Description
DiscussionTitle
DiscussionTitleLookup
PublishingCacheDisplayDescription
PublishingCacheDisplayName
Created_x0020_By
Modified_x0020_By
TaskDueDate
DLC_Duration
Duration
PublishingCacheDuration
Edit
_EditMenuTableEnd
_EditMenuTableStart
PermMask
EMail
Email2
Email3
EmailBody
EmailCalendarDateStamp
EmailCalendarSequence
EmailCalendarUid
EmailCc
EmailFrom
RelevantMessages
EmailSender
EmailSubject
EmailTo
PublishingCacheEnabled
EncodedAbsUrl
_EndDate
EndDate
ol_EventAddress
EventCanceled
Event
EventType
Expires
ExtendedProperties
OffsiteParticipant
OffsiteParticipantReason
WorkFax
File_x0020_Size
FileSizeDisplay
File_x0020_Type
FileType
FirstName
FirstNamePhonetic
FormCategory
FormData
FormDescription
FormId
FormLocale
FormName
LinkTemplateName
FormRelativeUrl
FormVersion
FormURN
_Format
FTPSite
FullName
FullBody
Gender
GovernmentIDNumber
Group
GUID
_HasCopyDestinations
HasCustomEmailBody
PublishingHidden
Hobbies
HomeAddressCity
HomeAddressCountry
HomeAddressPostalCode
HomeAddressStateOrProvince
HomeAddressStreet
HomeFaxNumber
HomePhone
Home2Number
xd_ProgID
HTML_x0020_File_x0020_Type
ID
IMAddress
PublishingImageCaption
Indentation
IndentLevel
Initials
InstanceID
IsActive
_IsCurrentVersion
IsRootPost
xd_Signature
IsSiteAdmin
ISDNNumber
LinkIssueIDNoMenu
IssueStatus
FSObjType
JobTitle
Keywords
Language
LastNamePhonetic
_LastPrinted
DiscussionLastUpdated
LessLink
_Level
LimitedBody
WorkflowLink
List
Location
ManagersName
MasterSeriesItemID
Combine
MessageId
MiddleName
_PublishingMigratedGuid
Mileage
CellPhone
Last_x0020_Modified
Modified
Editor
MoreLink
BaseName
FileLeafRef
LinkFilename
LinkFilenameNoMenu
NameOrTitle
Nickname
Office
AdminTaskOrder
Order
OrganizationalIDNumber
OtherAddressCity
OtherAddressCountry
OtherAddressPostalCode
OtherAddressStateOrProvince
OtherAddressStreet
OtherFaxNumber
OtherNumber
Outcome
WorkflowOutcome
owshiddenversion
PublishingPageContent
PublishingPageIcon
PublishingPageImage
PublishingPageLayout
PagerNumber
ParentFolderId
FileDirRef
PendingModTime
PublishingCachePerformACLCheck
PersonalWebsite
Picture
ImageHeight
ImageSize
ImageWidth
BodyAndMore
PersonImage
PersonViewMinimal
StatusBar
PreviewOnForm
PublishingPreviewImage
Item
PrimaryNumber
Priority
Profession
ProgId
MetaInfo
PublishedDate
_Publisher
QuotedTextWasExpanded
RadioNumber
fRecurrence
RecurrenceID
RecurrenceData
RedirectURL
EmailReferences
ReferredBy
TaskCompanies
RelatedIssues
_Relation
RepairDocument
ItemChildCount
ReplyNoGif
RequiredField
_Identifier
_ResourceType
AttendeeStatus
ReusableHtml
ReusableText
_Revision
_RightsManagement
Role
PublishingRollupImage
PublishingAuthenticatedUse
PublishingExpirationDate
PublishingStartDate
ScopeId
SelectFilename
SelectTitle
SelectedFlag
SendEmailNotification
ServerUrl
_SharedFileIndex
ShortestThreadIndex
ShortestThreadIndexId
ShortestThreadIndexIdLookup
ShowCombineView
ShowInCatalog
ShowRepairView
SipAddress
_Source
ParentLeafName
_SourceUrl
ParentVersionString
SpouseName
StartDate
WorkState
_Status
DecisionStatus
HeaderStyleDefinitions
LinkDiscussionTitle
LinkDiscussionTitleNoMenu
Subject
Suffix
SummaryLinks
SummaryLinks2
SystemTask
Audience
TaskGroup
TaskStatus
TaskType
TelexNumber
TemplateId
TemplateUrl
ThreadIndex
ThreadTopic
Threading
ThreadingControls
Thumbnail
EncodedAbsThumbnailUrl
TimeZone
LinkTitle
LinkTitleNoMenu
SurveyTitle
Title
ToggleQuotedText
TotalWork
TrimmedBody
TTYTDDNumber
DocIcon
Purpose
_UIVersion
UID
UniqueId
URL
URLNoMenu
URLwMenu
FileRef
UserField1
UserField2
UserField3
UserField4
User
PublishingVariationGroupID
PublishingVariationRelationshipLinkFieldID
PublishingAssociatedVariations
PublishingVaryByCustom
PublishingVaryByHeader
PublishingVaryByParam
PublishingVaryByRights
_UIVersionString
_Version
VirusStatus
EncodedAbsWebImgUrl
WebPage
Preview
WikiField
WorkflowAssociation
WorkflowInstance
WorkflowInstanceID
WorkflowItemId
WorkflowListId
WorkflowName
WorkflowTemplate
WorkflowVersion
WorkspaceLink
Workspace
XMLTZone
WorkZip

Friday, February 26, 2016

PowerShell to know the SQL Server DB Name for a site collection

SQL Server DB Name for a specific SharePoint site collection

If you are having the central admin access of SharePoint, then follow the below steps to know the Database name of a particular site collection


Follow these steps:
  1. Open Central Administration.
  2. Go to "Application Management".
  3. Click on "View all site collections".
  4. Select the site collection you need to get the database name.
  5. In the panel on the right you should see "Database Name", that's the name of the content database.


If you are not having central admin access, you can use the PowerShell to know the same.  Open SharePoint 2010 Management Shell.

PS C:\Users\<username> $url="http://<host-name>/sites/<site collection name>"
PS C:\Users\<username> $site = Get-SPSite $url
PS C:\Users\<username> $site.ContentDatabase.name
WSS_Content

So in this case "WSS_Content" is the Content Database Name which is  being used by this site collection.



Wednesday, January 27, 2016

Restore a Site Collection using PowerShell

Restoring the site collection once it gets deleted inadvertently.

You need the full URL of the site collection which you want to restore back to start. 
 
Step1 : For Example, I have a root level site collection having full URL as "http://<<host name>>:10000".
You  can execute Get-SPSite cmdlet to get the site object.
 $mysite = Get-SPSite http://<<host name>>:10000
 
Step2: You can print the GUID of that site by using "id" property of that object in last step.
PS C:\Users> $mysite.id
Guid
----
7044efc1-786f-493b-b3d5-0056add40bb9
 
Step 3: Then you can use "Get-SpDeletedSite" cmdlet with the id as a parameter to confirm the other details of that site collection such as path and deletion time.
 
PS C:\Users\> Get-SPDeletedSite $mysite.id
WebApplicationId   : 740953c9-7041-4130-994a-7d85864975d3
DatabaseId         : 78e0f455-c59d-4404-83c7-085309762fdc
SiteSubscriptionId : 00000000-0000-0000-0000-000000000000
SiteId             : 7044efc1-786f-493b-b3d5-0056add40bb9
Path               : /
DeletionTime       : 1/26/2016 9:40:22 PM
 
Step 4: Last step is to run "Restore-SPDeletedSite" cmdlet with the "-Identity" parameter. You have to pass on the same id or GUID which you got in last steps. Press 'Y' for confirmation.
 
PS C:\Users> Restore-SPDeletedSite -Identity $mysite.id
Confirm
Are you sure you want to perform this action?
Performing operation "Restore-SPDeletedSite" on Target "/".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help
(default is "Y"):Y
 
After execution of step4, your site collection would get restored back.
 

Thursday, January 7, 2016

Run a SQL Server procedure from Excel


I'm using SQL Server 2008 Enterprise. I created a stored procedure in one database. The stored procedure is composed of several queries from the same database. Final combined result set is being displayed.

I try to execute it via Excel to create a report from the output which I got from stored procedure, so the results will appear automatically in Excel sheet, but I'm getting the below error:


Once I was creating the SP with the simple SQL Queries, it was working fine, but not for the stored procedure which are having multiple queries, loops and other functionality

After trying various different option, I found the solution of this.

I added "SET NOCOUNT ON" to the beginning of the stored procedure.

Here is the link which can be helpful to read about this.
https://msdn.microsoft.com/en-us/library/ms189837.aspx