Tag Archives: configuration

Create a Page in SharePoint sub site is not adding to the sub site but the Root site

I hope the post title did not confuse you. I hit this weird behaviour in SharePoint when I was in “www.sharepoint.com/subsite” trying to create a Page in “www.sharepoint.com/subsite/pages” library. The dialog shows URL of Root Site in “Find It at”

create a page not adding to correct site 1

If you proceed to create the page, it will be added into ROOT SITE! which is not what I wanted

Resolution

To avoid confusing and to make the “add a page” adds pages to the correct site. Please do the following:

  1. Go to your sub site setting page
  2. Go to “Navigation” under look and feel section
  3. Uncheck the field “
  4. Click “OK” an save

Once you have unchecked the field, your “add a page” is now adding to the correct subsite!

 

SharePoint Installation Error – Requires .NET Framework 4.5 despite having .NET Framework 4.6

I was puzzled when trying to install SharePoint 2013 in Windows 2012 R2. For the past few months when I was doing the same steps, this error did not occur.

If you have done Prerequisite Installation and trying to install SharePoint 2013, You MAY encounter this error message

Setup is unable to proceed due to the following error(s):

This product requires Microsoft .Net Framework 4.5.

Net 4.6 error when installing SP2013

Having checked in your registry stated here, my .net framework was 4.6 (huh? isn’t 4.6 is better and higher version than 4.5 that’s required?)

Yea, so the installer does have a little issue if we have Higher version of .Net Framework.

Resolution

They underlining issue for this is that the Windows 2012 R2 provisioned is pre-installed with .NET Framework 4.6

To undo this 4.6 version, you would have to go to your Control Panel and uninstall the KB3102467 Windows Update

uninstall sharepoint kb .net 4.6

PowerShell script to disable Limited Access Lock Down mode for all Site Collections

I always like to make use of PowerShell to do stuff. When dealing with a lot of Site Collection, it is advisable to script your task than going through UI one by one to configure.

I have a requirement to take out the Limited Access Lock Down mode introduced in SharePoint 2013. A bit introduction for this feature, this feature actually BLOCK users from browsing a file (via Browser) or check-in/check-out a file (via Office Client such as Word).

limited access user permission lockdown mode

If you activate this lock down mode, SharePoint does not allow browsing of its parent and hence you will receive error when trying to edit a file via Office Client (even if you have contribute permission to the file itself!). If you are only allowing your users (usually external or someone who does not have permission to the entire web or document library) to read the file, you do not need to Deactivate this.

In my environment, its much more complicated where some users are only editable to file from other Sub Site or Site. And Content Owners always assign Individual file for other site’s user to edit. In this case, in order to allow seamless experience, I would need to make sure that this feature is Deactivated at all site collections.

I came out with this PowerShell, Short and Sweet one, to help me. Hope it helps!


Get-SPSite | % {
  Get-SPFeature -Site $_ | ? { $_.DisplayName -eq "ViewFormPagesLockDown"} | Disable-SPFeature -Url $_.Url -Confirm:$false
}

P.S. Run it via SharePoint Management PowerShell. Or else you need to add in “Add-PSSnapIn Microsoft.SharePoint.PowerShell” at the start of this script.

A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.

This is a very common error that SharePoint Developers often face. As stated in the error message, this is due to SafeControl Elements in Web.Config file of your SharePoint Application not being added correctly, or perhaps pointing to the wrong type name.

Resolution

To solve this issue, you’ll need to make sure that the SafeControl Entries in your SharePoint solution projects is configured correctly.

Step 1 – Find out what is the correct type name.

  1. Navigate to your .webpart file in Visual Studio that you’ve misconfigured.
  2. Double clicking it to open the webpart file.
  3. Copy the Type Name and exclude the last node
    web part register 1
  4. Alternatively, go to your web part .cs file and copy the Namespace
    web part register 2

Now that you have the correct type name. You need to…

Step 2 – Specify the right Safe Entry

  1. Click on the Web Part
  2. Under Properties panel, click on the … icon beside Safe Control Entries
    web part register 3
  3. Enter the value found in Step 1 into Namespace field as shown below.
    web part register 4
  4. Deploy and Done!

PowerShell script to Open or Close SharePoint Web Parts

If you ever need to make changes to your SharePoint Web Parts such as hiding/showing, this post will help you to cut down unnecessary time.

Run the PowerShell script below via SharePoint Management Shell.

Change the Parameter accordingly base on your environment.


$web = Get-SPWeb [URL]
$f = $web.GetFile("Pages/Default.aspx");

if( $f.CheckOutStatus -eq "None" )
{
  $f.CheckOut();
}
$wpm = $f.GetLimitedWebPartManager("Shared")
$webParts = $wpm.WebParts | ? {$_.GetType().Name -eq "ContentEditorWebPart"} //Change for your own web part type
if($webParts.GetType().Name -eq "Object[]")
{
  $webParts | % {
    #$wpm.CloseWebPart($_);
    $wpm.OpenWebPart($_);
    $wpm.SaveChanges($_);
  }
}
else
{
  #$wpm.CloseWebPart($webParts)
  $wpm.OpenWebPart($webParts)
  $wpm.SaveChanges($webParts)
}

$f.CheckIn("");
$f.Publish("");

The example above will check if the page is check out before making any changes to the web parts. Subsequently, it closes/opens all content editor web parts within it and check in and publish the page. You can additional perform more tasks such as DeleteWebPart or AddWebPart, MoveWebPart or only make changes to only certain type of web part by changing PowerShell rules

 

Convert SharePoint 2010 Solution to 2013 – 15 Hive Folder only

Bumped into this problem where I was trying to convert old codes from SharePoint 2010 to SharePoint 2013.

One issue that you will encounter is that all your Element Files being uploaded to 14 Hive folder (the old 2010 path) rather than the new 15 Hive folder.

If you deploy your solution directly into a SP2013 environment, you will encounter reference link broken or file not found due to codes/files not being deployed to 15 Hive.

One Workaround is to actually deploy your solution with switch -CompatibilityLevel All (for detail please refer here ). However, you can’t always remember to do this steps and in order for you to really upgrade your solution to SP2013, You need to make some changes to the manifest file. And steps below show you how to change it permanently and only stick to 15 hive folder.

Resolution

  1. Open your SharePoint solution via Visual Studio.
  2. Expand the Package folder and Double click “Package.package
  3. Under Properties Panel, change the property “SharePoint Product Version” from 14.0 to 15.0
    upgrade sp2010 to sp2013 solution
  4. Package it and done!

P/S What I additional did to make sure there is no reference link broken is to Find ALL “_layouts/“, “_CONTROLTEMPLATES/” and replace with “_layouts/15/” and “_CONTROLTEMPLATES/15/

Changing Default HomePage for Document Center to a Document Library

As stated in the Title, it is easier said than done to change the default landing page of a Document Center. If you have done publishing sites often, you will usually go to “Welcome Page” in the site setting page to do it.

welcome page publishing

But in Document Center site, this feature is missing and what’s even worse, that there is no Pages or Site Pages library for you to set the homepage

[I’m referring to the set homepage feature below]

make home page

So how to change the default landing page for SharePoint Document Center?

The trick is simple, all you need to do is to go to the Document Library that you want to make default home page.

Hit on the “Edit Page” menu under Site Action gear.

edit page in document library

Once the Document Library page is in Edit Mode, you shall see additional Ribbon Tabs appear and shown below, Go to “Pages” tabs and now you can set the HOME PAGE! (hidden gem)

document library make homepage

There are alternative ways of doing this such as running PowerShell etc. but I personally find this the quickest and easiest way to do it.

Hope it helps!

 

SharePoint Search Content Source Crawl Log Access Denied

I have the following issue when setting up SharePoint 2013 Search Service Application.

Whenever I started full crawling my content sources, after certain time (usually the next day). Content Sources page and Crawl Log will give Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
search service application content source access denied

Checking Search Instance Server’s Application Log and you can see the following error

The Execute method of job definition Microsoft.Office.Server.Search.Administration.IndexingScheduleJobDefinition (ID e611e95c-dc0a-40ee-a3a3-c58f2099c2d1) threw an exception. More information is included below.

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Event ID 6398

Subsequently go to Central Administration page > Timer Jobs to look for the respective Timer

Found “Indexing Schedule Manager on xxxServerNamexxx” failed miserably, for every 5 minutes.

It was then found that some user has this issue previously which has got something to do with TASKS folder in your C:\WINDOWS

sharepoint search windows task access denied issue

In case if you do not have the history of your Domain GPO, this particular folder was previously a target for Conficker Worm virus. Refer here. MS recommended to actually change the permission of this folder which then conflict the requirement for SharePoint Search Service.

If you are interest in checking your own GPO setting, you can simply run “rsop.msc” in your server’s RUN command. And you should be able to see the settings made as per below

sharepoint search windows task access denied issue conflicker

 

Workaround

In order to solve the issue, you have to get your AD GPO team to remove this setting from your sharepoint servers. Explicitly for this requirement or else your search cannot crawl.

For temp solution, you have to change the Owner of this TASKS folder and grant

WSS_WPG with minimum “Read” and “Write” access.

Finger Crossed

Office Web Apps Sorry, there was a problem and we can’t open this document. If this happens again, try opening the document in Microsoft Word.

Got this error after configuring Office Web Apps for SharePoint.

officewebapp sorry there was a problem

Digging into the ULS for Office Web App [C:\ProgramData\Microsoft\OfficeWebApps\Data\Logs\ULS\***] and found the following error messages when browsing a document via OWA

HttpRequestAsync, (WOPICheckFile,WACSERVER) no response [WebExceptionStatus:ConnectFailure, url: xxxxxxx
...syncResult asyncResult, Exception& exception)

WOPI CheckFile: Catch-All Failure [exception:Microsoft.Office.Web.Common.EnvironmentAdapters.UnexpectedErrorException:
HttpRequest failed ---> Microsoft.Office.Web.Apps.Common.HttpRequestAsyncException:
No Response in WebException ---> System.Net.WebException:
Unable to connect to the remote server ....
FileUnknownException while loading the app....

 

Checking Application Event Logs and got the following error

Exception type: ExcelWebRendererException Exception message:
We couldn't find the file you wanted.
at Microsoft.Office.Excel.WebUI.EwaState.OpenWorkbook()
...

Turned out that this is due to certain URL not being resolvable by Office Web App Servers.

Here is the catch, the SharePoint Web Application of mine is using multiple Zonez for authentication. The default zone was used for internal servers (not registered in DNS) while Intranet Zone was used for all users.

After the SPWOPI binding is done, the OWA takes in the Default Zone URL whenever user accessing office document via Intranet Zone. The Default Zone’s URL is never set in DNS and hence error thrown.

Resolution

The workaround is to change the HOSTS file in OWA server (C:\Windows\System32\drivers\etc\hosts) to add in the IP of SharePoint Web Server with Default Zone’s URL.

Alternatively, if the Default URL is okay to be exposed to public. Please feel free to add in a DNS record.

Target Audience in Web Part Property is missing.

Or rather how to prevent Target Audience feature in Web Part from missing.

I bumped into this problem where I wanted to set a web part to show only to a certain group of users.

Checking the Web Part properties does not show the Target Audience column. The behavior of this Target Audience web part property is that it will be shown (which we thought it was supposed to be shown by default), only when there is User Profile Service Application associated to your web application. (which usually will be provisioned automatically if you configure the farm via wizard).

user profile service application association

One reason for not associating this is for to prevent user from accessing My Site when they hit “About Me” site action menu.

about me

For some reason, this will also turn off the Target Audience in the Web Part. So. In order to turn on back the target audience feature. Here are the steps.

Resolution:

  1. Go to SharePoint Central Admin
  2. Go to Application Management and hit “Configure service application associations”
  3. In your web application row, hit the application proxy group to show the associations.
  4. Tick “User Profile Service Application” and hit OK.
  5. Your web part should immediately show Target Audience property

web part property target audience sharepoint