SharePoint
SharePoint 2013 Excel Service 401 Error
Recently when I’m working with SharePoint Excel services i received below error message.
“Before Opening Book ObjectSystem.Net.SystemNetworkCredentialSystem.Net.WebException: The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at ExcelService.OpenWorkbook(String workbookPath, String uiCultureName, String dataCultureName, Status[]& status)”
to get rid of this error you have to disable “Loopback Check” from front end servers and app servers. you can follow these steps to disable Loopback Check.
Method 1: Specify host names (Preferred method if NTLM authentication is desired)
- Click Start, click Run, type regedit, and then click OK.
- In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
- Right-click MSV1_0, point to New, and then click Multi-String Value.
- Type BackConnectionHostNames, and then press ENTER.
- Right-click BackConnectionHostNames, and then click Modify.
- In the Value data box, type the host name or the host names for the sites, and then click OK.
- Quit Registry Editor, and then restart the IISAdmin service.
Method 2: Disable the loopback check (less-recommended method)
- Click Start, click Run, type regedit, and then click OK.
- In Registry Editor, locate and then click the following registry key:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
- Right-click Lsa, point to New, and then click DWORD Value.
- Type DisableLoopbackCheck, and then press ENTER.
- Right-click DisableLoopbackCheck, and then click Modify.
- In the Value data box, type 1, and then click OK.
- Quit Registry Editor, and then restart your computer.
Happy Coding
Anonymous Users get Credentials Prompt For Default “osssearchresults.aspx” Search Page on SharePoint Publishing Site
Recently i came across a weird kind of issues..i have SharePoint 2013 farm with Several host header site collection.those site collections are enable to the public also, therefore all anonymous users can view those site collections.Except one site collection anonymous user can access “osssearchresults.aspx” default search page.all site collections are in the same web application.to verify the problem i created a separate web part page and inserted “Search Box” web part and “Search Result” Web part.still the same problem new page also prompting the user credentials for anonymous users.then i used fiddler to identify what are the pages that are prompting permission.actually it’s not pages. there are some “JS” files that required user credentials. reason is those files are not published properly.so what i did was i “checked in” all those “JS” files by publishing major version of those files.
*Note :- “Control_SearchBox.js and Control_SearchResult.js” are the two main files related to “osssearchresults.aspx” page..therefore make sure you publish/”check in” the major version of those two files.
below you can find two directories.you need to “check in” all unpublished “JS” files in these two directories.using SharePoint designer navigate to these directories and publish/”check in” new version of it’s “JS” files.SharePoint use these “JS” files in “Search Box” and “Search Result” Web Parts.if these files are not publish/”check in” properly that means anonymous users cannot access these files.that’s why “Search Box” and “Search Result” web parts are prompting for credentials.
“Catelogs/masterpages/display template/search”
“Catelogs/masterpages/display template/finters “
if the problem still exist use “Fiddler” to identify remaining files which are still prompting for credentials .you can download Fiddler using this link. Hope This is help to you.. 🙂
Brunei Cloud Users Group Monthly Gathering – October 2016
I’m really happy to announce that I will be speaking at the Brunei Cloud Users Group in Brunei, October 29 2016.
More Information
http://www.sharepointbrunei.net/
praneeth@sptricks.com
Brunei Cloud Users Group Monthly Gathering – October 2015
I’m really happy to announce that i will be speaking at the Brunei Cloud Users Group in Brunei, October 31 2015. http://www.sharepointbrunei.net/
SharePoint Brunei User Group Monthly Gathering – March 2015
I’m really happy to announce that i will be speaking at the SharePoint Brunei User Group in Brunei, March 31 2015. http://www.sharepointbrunei.net/
SharePoint Brunei User Group Monthly Gathering – October 2014
I’m really happy to announce that i will be speaking at the SharePoint Brunei User Group in Brunei, October 30 2014. http://www.sharepointbrunei.net/
Hide SharePoint “RibbonRow” and “SuiteBar” From Anonymous Users
For public facing SharePoint sites most of the time peoples don’t want to show SharePoint “Suitebar” and “RibbonRow” for Antonymous Users
So here how you can hide SharePoint 2013 “suiteBar” for anonymous users.
- Open the master page (default Master and the Home Page Master) using SharePoint Designer. Before edit your master page take a backup copy
2. Select your master page -> right click –>Click on “check out”
3. Select the master page again -> right click –> Click on “edit file in advanced mode”
4. Find the <div id=”suiteBar” class=”ms-dialogHidden noindex”> code block
5. Now change <div id=”suiteBar” class=”ms-dialogHidden noindex”> to <div id=”suiteBar” class=”ms-dialogHidden noindex” style=”display:none”>
This will hide the “suitbar” for all users including login users.but we need to enable suite bar for login users.to do that insert below script block right after the above </div> tag
6.Right click on <div id=”suiteBar” class=”ms-dialogHidden noindex”> to <div id=”suiteBar” class=”ms-dialogHidden noindex” style=”display:none”> code block and click on “Select Tag”
7. insert below script block right after the selected section
<!– My Custom Code –>
<SharePoint:SPSecurityTrimmedControl ID=”HideSuiteBar” runat=”server” PermissionsString=”ManageWeb”>
<script type=”text/jscript”>
document.getElementById(“suiteBar”).style.display = “block”;
</script>
</SharePoint:SPSecurityTrimmedControl>
<!– –>
This will hide SharePoint “SuiteBar” for Anonymous users.
Now we have to hide SharePoint “Ribbon Row”
8.Go to your master page. find <div id=”s4-ribbonrow” style=”height: 35px; display: inherit !important;”> code block.
9. Change <div id=”s4-ribbonrow”> to <div id=”s4-ribbonrow” style=” display:none”>
10. Right click on <div id=”s4-ribbonrow” style=” display:none”> code block -> click on “Select Tag”
11. Insert below script block right after the above selected </div> tag. (at the end of the Selected Tag)
<!– My Custom Code –>
<SharePoint:SPSecurityTrimmedControl ID=”HideRibbonRow” runat=”server” PermissionsString=”ManageWeb”>
<script type=”text/javascript”>
document.getElementById(“s4-ribbonrow”).style.display = “block”;
</script>
</SharePoint:SPSecurityTrimmedControl>
<!– –>
12. After Insert above code block .your page will look like below screenshot.
13. “Save” your changes and “Check In” the “Master Page”.
14. This is the final output / View for “anonymous” users.
Note :
You have to “Deactivate”Minimal Download Strategy” feature from “Manage Site Features” to take effect all these changes.
You can use below url to login to you site.because now you can’t see “Sign in” Link on your pages. 🙂
http://SiteUrl/_windows/default.aspx
Happy Coding
SharePoint Brunei User Group
I’m really happy to announce that i will be speaking at the SharePoint Brunei User Group in Brunei, September 20 2014. http://www.sharepointbrunei.net/
SharePoint Brunei User Group
I’m really happy to announce that i will be speaking at the SharePoint Brunei User Group in Brunei, August 13 2014. http://www.sharepointbrunei.net/
Change SharePoint List “Display Item Form” Close Button Default Redirect Location
- Create a new Page.( In my example I created a “Wiki” Page inside my “Site Pages” library.I inserted a header Called “Latest News“)
- Open the page using “SharePoint Designer“
Most of the times peoples are using display item form to display their list content in a page.By default SharePoint “display item form” Close button redirect you to the default view of the library where your page/document exists or default view of the list where your item exists. Some scenarios we want to change this redirect url. you can use several ways to achieve this. For an example you can use a JavaScript to achieve the same thing. In my case I’ll show you using a page parameter how we can change the Redirect page of a SharePoint “display item form” close button.In my example I have a list called “News” and I’m going to show the latest news in a different SharePoint page called “News” which is inside the “Site Pages” library.Currently this is my News list default Display Item form Url “http://spfoundation/_layouts/15/start.aspx#/Lists/News/DispForm.aspx?ID=1&Source=http%3A%2F%2Fspfoundation%2FLists%2FNews%2FAllItems%2Easpx” .This means after you click on Close button you will automatically redirect to “News” list default “AllItems.aspx” page.
So my goal is to change the “&Source” Parameter.
- Insert a new Display Item form
- Select your Display Item Form and click “Add/Remove Columns” button in the ribbon.this will brings the “Edit Column” window
- Remove unnecessary columns.in my example I used “Title” and “Content” Column
- Sort using “Id” to show latest Contents (this is not mandatory.You can skip this step)
- Find “<xsl:template name=”dvt_1.rowview”>” tag
- Change the table data (<td>) content like below .
- Select the Display Item Form and click on Parameter button.this will open the Data View Parameter Window
- Create a new Parameter called “Source” and for the “Default Value” give your redirect page url.in my example im redirect to my home page and click ok ..
- Add our new parameter at the end of your column url.in my example it’s “Title” column url.
- Save and Close Your Page. That’s it
this is how my page looks like
- This is my new Display item Form Url “http://spfoundation/Lists/News/DispForm.aspx?ID=1&Source=http://spfoundation” previously it like this
“http://spfoundation/_layouts/15/start.aspx#/Lists/News/DispForm.aspx?ID=1&Source=http%3A%2F%2Fspfoundation%2FLists%2FNews%2FAllItems%2Easpx”
Happy Coding