Showing posts with label Sharepoint 2013. Show all posts
Showing posts with label Sharepoint 2013. Show all posts

Thursday, August 23, 2018

SharePoint 2013 Site collection Launch page – Access Denied error


Recently I got an issue while login to one of the host-named web application. All of sudden when I try to open the site, it shows me access denied error. I have removed and added myself as Site collection Administrator and still same error. I have added myself in Super reader and Super User in Web application policy. But still same issue.

After checking for some more time, I found that I am able to access all the pages and libraries by entering the URL directly (Eg: /SitesPages/Home.aspx , /Pages/Default.aspx) . I have verified if this is issue with DNS entry, but I am able to navigate to the site but it is throwing access denied error. I have verified Authentication providers, if there is any issue with Claims authentication.  But nothing worked.

After some time I found this post on the issue. We got the issue due to Authentication settings got corrupted. After enabling and disabling the Anonymous access for the web application my issue got resolved.

Here are the steps to fix the issue,

Open SharePoint 2013 Central Administration site, click on Manage web applications.



Select the web application that has the issue and click on Authentication Providers from the ribbon bar.


Open the authentication provider zone we are using, We can see it as default.


Check the Enable anonymous access option and then Save the Authentication settings. It can take some time to save the settings, so after click Save just need to wait for the Authentication Setting window to close.





After the Authentication settings window closes we should be able to get to the home page without any Access Denied errors.

Now we don't want to leave anonymous access enabled so once again open the authentication provider zone and un-check Enable anonymous access and then Save the Authentication settings. We should now still be able to access the root site of web application and the issue has been fixed.

Thursday, July 12, 2018

SharePoint 2013 error – Unexpected response from server, The status code of response is '500'. The status text of response is 'System.ServiceModel.ServiceActivationException'.


One of my client using SharePoint standalone machine for 400 people for their internal applications. Everything working as expected but one day all of sudden got an error message saying that,

Unexpected response from server, The status code of response is '500'. The status text of response is 'System.ServiceModel.ServiceActivationException'.



This error cause due to high memory usage in the server. Verify task manager and check what service taking more time. In my case Search service taking much time. We can fix the issue using options below,

Option 1: Search Service Node Runner.exe

Reduce the Search Service Performance Level with

Set-SPEnterpriseSearchService -PerformanceLevel Reduced

As NoderRunner.exe is the process working on search service, we can limit the memory for NodeRunner.exe. But this is not recommended. We can change the configuration located in “C:\Program Files\Microsoft Office Servers\15.0\Search\Runtime\1.0\noderunner.exe.config

Option 2:  Restart servers

For Temporary solution like users wants to make SharePoint up and Running, Restart the server, so that you can see the error temporarily (You get some time to increase resources or restrict Services to specific value)

Hope this helps to resolve the issue.

Thursday, June 14, 2018

SharePoint 2013 security patch issue – AccessKey too long, cannot be more than one character


After installing SharePoint 2013 march updates, when I try to configure User Profile Service Application I got an error saying that - AccessKey too long, cannot be more than one character. By seeing the SharePoint logs, I found an error saying that

Application error when access /_layouts/15/ProfileSynchronizationServiceProvisionPage.aspx, Error=AccessKey too long, cannot be more than one character. Parameter name: value
 at System.Web.UI.WebControls.WebControl.set_AccessKey(String value)
 at Microsoft.SharePoint.Portal.WebControls.InputFormButtonAtBottom.set_AccessKeyLocId(LocStringId value)
 at ASP._layouts_15_profilesynchronizationserviceprovisionpage_aspx.__BuildControl__control11()
 at ASP._layouts_15_profilesynchronizationserviceprovisionpage_aspx.__BuildControlProfileSyncProvisionSettingsForm()
 at ASP._layouts_15_profilesynchronizationserviceprovisionpage_aspx.__BuildControl__control4(Control __ctrl)
 at System.Web.UI.MasterPage.InstantiateInContentPlaceHolder(Control contentPlaceHolder, ITemplate template)
 at ASP._admin_admin_master.__BuildControlDeltaPlaceHolderMain()
 at ASP._admin_admin_master.__BuildControl__control27()
 at ASP._admin_admin_master.__BuildControlSPHtmlTag()
 at ASP._admin_admin_master.__BuildControlTree(_admin_admin_master __ctrl)
 at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
 at System.Web.UI.Page.ApplyMasterPage()
 at System.Web.UI.Page.PerformPreInit()
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I have verified the details about the issue I don’t see any clues about the issue. Some suggested to replace the /_layouts/15/ProfileSynchronizationServiceProvisionPage.aspx file from Stage/Dev. But I cannot risk that with my production environment. I have seen same issue few other people and they have the same error after installing March 2018 updates as the TechNet forum.

After two days Stefan Goßner posted the fix for the issue.  Here are the steps to fix the issue,
  1. Delete the content of the following folder:
    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
  2. Restart IIS . This will allow aspx pages to recompile.




Friday, June 26, 2015

SharePoint User Display issue: Display name incorrect in one site collection

Recently I got an issue in my SharePoint 2013 production environment. One of the user display name not showing properly. Instead of his name, it is showing one of the employee who left the organization. By checking the user details in AD we got the details. AD team updated two emails for one user. One is his own email and other email is one of the employee who left the company. We tracked the issue and updated the profile AD and ran User Profile Sync. Everything worked well till now.

But user still having the issue in one site, his display name not showing correctly. Instead of his name, it is showing employee who left the organization. We are seeing this issue only for one site collection. Tried different approaches like deleting user permissions in the site through UI and using PowerShell commands. Nothing worked.

After Googling the issue, we got the resolution. We are seeing that issue due caching in SharePoint site collection. When I remove and add the data in SharePoint site group, SharePoint site collection user details from all users located in <Site URL>/_layouts/people.aspx?MembershipGroupId=0


To fix the issue, we need to remove the user from all users list and read it to the list. But before that we need to check all the user permissions in the site (including all the groups and individual permissions) and need to re add all the places. 

Hope this helps.

Wednesday, June 24, 2015

Copy-SPSite: Rename/Recreate SharePoint site collection

Most of my clients had a requirement to rename SharePoint site collection in all SharePoint versions including SharePoint 200, 2010 and 2013. To do that we have to take the existing site collection backup, Delete the site collection and Restore it new site collection. If anything happens in this process, we are gone. Nothing left.

But in SharePoint 2013 we got new command, Copy-SPSite command allows us to copy the site collection. This option allows us to duplicate the site collection to new site collection. We have options to specify the destination DB.

Here is the syntax for Copy-SPSite command,

Copy-SPSite Source Site URL [-DestinationDatabase Destination DB] -TargetUrl Target Site URL

We can use this command to copy the site collection in same content DB. Copy-SPSite command will not work for copy the site collection in other content databases. To do this we have to follow backup and restore process.

We can copy host named site collections using Copy-SPSite command.

Copy-SPSite -Identity Source Host Named Site collection URL -TargetUrl Destination Host Named Site collection URL -HostHeaderWebApplication Host Header web application URL

Before that we need to run Remove-SPSiteUrl command as below.


Remove-SPSiteURL -URL Host named Site collection URL

Saturday, June 20, 2015

SharePoint 2013 error – Site stuck up in Read-only mode after interrupted backup

While working with SharePoint 2013 restore and backup I got interesting error in one of my host named site collection (I hope this is generic issue, not specific to host named site collection) saying as shown the image below.



When I try to fix this issue from SharePoint central administration quotas, all the options are disabled and unable to change anything as shown the image below.


By going through some of the blogs, I got the issue. In SharePoint 2013, we are having Manintanence Mode property for SPSite makes SharePoint site is undergoing a Maintenance & is read only. We can set this SharePoint site when content DB is in read only state, or when SharePoint site upgrade, moving SharePoint site in process.
We can fix this error by clearing ClearMaintenanceMode method in SpSiteAdministration object. We can do this by running following command,
$Site = new-object Microsoft.SharePoint.Administration.SPSiteAdministration(SITE URL)  $Site.ClearMaintenanceMode()
This fixed my issue. Hope this helps.



Friday, May 8, 2015

Prevent users to create the my sites in SharePoint

In one of my SharePoint environment, we had issue with my sites. When users click on about us, it automatically creates my site for all the user. All these my sites are created as a site collections in the web application.



We have 2000 people accessing the site and every user creating new my site. So it will be 2000 site collection in one web application. SharePoint can handle that, but we not using any my site features in our environment.
For this we just need to prevent the users to create my sites. We can do that from central admin site User profile service settings as shown below.

Open SharePoint central admin site User profile Service application. Select manage user Permissions.



We can see a popup as shown below. Select Authenticated users and uncheck “Create personal sites” option as shown the image below.
Click on Ok to save the settings.



Hope this will helps.


Monday, April 27, 2015

SharePoint – Back to basics – SPLongOperation for lengthy operations

We have many hidden features in SharePoint in look and feel in Out of Box as well as custom. SPLongOperation One of the hidden feature in custom coding side. This feature exists from SharePoint but many of the users may not be aware of this. SPLongOpearation allows us to inform end users on processing screen while operating lengthy operations like moving documents from one site other, deleting sites etc... And at the end we can have options to close/ redirect the page.

Here is the sample code on usage of SPLongOperation,

               try{
                              using (SPLongOperation longOpearation = new SPLongOperation(this.Page))
                              {
                                             longOpearation.LeadingHTML = "Title of the long operation";//title message
                                             longOpearation.TrailingHTML = "this will take few sec”//sub message
                                              longOpearation.Begin();
                                             //Code start
                                             //Write the code that to be processed in long operation
                                             //code ends
                                               HttpContext context = HttpContext.Current;
                                             if (context.Request.QueryString["IsDlg"] != null)
                                             {
                                                            context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
                                                            context.Response.Flush();
                                                            context.Response.End();
                                              }
                                              else
                                              {
                                                             string url = SPContext.Current.Web.Url;
 longOpearation.End(url, SPRedirectFlags.CheckUrl, context, string.Empty);
                                             }

                              }
               }
               catch (Exception ex)
              {
                              SPUtility.TransferToErrorPage(ex.ToString());//transfores us to the error page with error message
               }

In the Begin and End methods for long operation we can have different overloaded methods. By using SPLongOperation.Begin method (String, String, SPLongOperation.BeginOperation) method we can pass title and sub message. Here in the script end method, iam passing redirection URL and checking flags and current context. For more details, here is the full description in msdn.



Sunday, April 26, 2015

SharePoint error – A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.

While working on one of the existing SharePoint server, I tried to open the SharePoint central admin site. I got an error saying that “A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.” As shown the image below.



This is the error due to SQL server service got stopped. To fix the error we have to run the SQL Service as shown the image below.



But in my case, MSSQLSERVER service is started and running. Restarted the service, but it wasn’t worked for me. By digging in to the deep I got few details from system admin. The farm I am working is already had few sites. But before handing that to me all the sites deleted from SQL server. When I try to access the CA site it gives the error message.

Restarted SharePoint timer service, SQL server and all the servers in the farm. Nothing worked for me. Finally ran SharePoint configuration wizard. Super... it worked for me. Now I got the issue that some of my farm users deleted DB’s in sql server directly instead deleting form CA. By running the config wizard


Friday, April 3, 2015

SharePoint 2013 - Update master page styles in SharePoint hosted apps without coding

One of my project I got a requirement to remove top suite links in a SharePoint hosted master page. But app was not developed by us. It is third party app. We don’t have code for the app. We just got app file and configured it in app site collection.

But one of management asked us to remove top suite links (Sites, One Drive and Newsfeed). We need to update the app master page links. I have worked on app, but all did form code side. But we don’t have code access now.


Generally we can have options to see site settings and all site contents of the app web by navigating to http://appweburl/_layouts/settings.aspx, http://appweburl/_layouts/viewlsts.aspx ). But in our app, app developers restricted to view those pages. I have tried to edit the app page as it is general SharePoint page. But I am unable to edit the page.

Finally a simple trick worked for me. Navigated to master page gallery http://appweburl/_catalogs/masterpage. Yes, I have access to master page gallery. In master page gallery I have seen all master pages related to SharePoint 2013 (app.master, seattle.master, oslo.master..etc.) By default app web use app.master page. Download app.master to your local and add CSS/JavaScript code to the master page. Upload it to masterpage gallery again.



In my case I just made added #DeltaSuiteLinks{display:none} style in the master page. It worked for me. But make sure check this before in Dev/Stage before updating the production.


Hope this helps.

Saturday, March 21, 2015

Exception from hresult 0x800a03ec excel - Error ‘Microsoft Office Excel cannot access the file’ while accessing Microsoft Office 11.0 Object Library

We got this error with SharePoint 2007 farm custom coding. Code downloads all the list items to excel template. Generally we can see this error with rows updating in excel. But we haven’t changed anything from DEV to PROD. We have investigated the error in SharePoint logs and Event logs.
We are seeing the error as there are several possible reasons: 
·           The file name or path does not exist.
·           The file is being used by another program.
·           The workbook you are trying to save has the same name as a currently open workbook.
After checking the issue. We have found that there is the error with excel service. To fix that we have to create a folder.

If we are running in Windows Server 2008 64-bit/R2,
·           Navigate to C:\Windows\SysWOW64\config\systemprofile folder and create the following directory “Desktop”
If we are running in Windows Server 32-bit
·           Navigate to C:\Windows\System32\config\systemprofile\Desktop folder and create the following directory “Desktop”

If still you have the issue, you have to change the security setting to run excel application using following steps,

·           Start –> enter DCOMCNFG.exe to open Component Service
·           This will bring up the component services window, expand out "Console Root" -> "Computers" -> "DCOM Config"
·           Find "Microsoft Excel Application" in the list of components.
·           Right click on the entry and select "Properties"
·           Go to the "Identity" tab on the properties dialog.
·           Select "The interactive user."
·           Click the "OK" button.
·           Switch to the services console
·           Start the service automating Excel
·           Test you application again.


Enable Windows authentication in IIS if excel application in your site prompting for credentials.

Saturday, March 14, 2015

Get all the site collection with content DB details using powershell commands

As discussed earlier power shell commands are pretty powerful than SharePoint object model code. Some time we can't run SharePoint object model code in production environment like gathering site/server/DB details.

We can get sites and content DB details using following power shell commands 


$rootSite=New-Object Microsoft.SharePoint.SPSite("Web app URL")
$spWebApp = $rootSite.WebApplication 
foreach($site in $spWebApp.Sites) {
    
    write-output "$($site.RootWeb.Url) - $($site.ContentDatabase)"     
  
    $site.Dispose() 


Wednesday, March 11, 2015

Create explicit managed path for host named site collection using PowerShell commands

In SharePoint 2013, host-named site collections (HNSC) are all the rage. Host-named site collections give you the ability to provide completely different URLs for a site collection regardless of the web application URL hosting it.  For example, you might have a web application URL named http://sharepoint.mycompany.com and under it you have a collaboration site with a URL of http://collaborate.mycompany.com and an Intranet site namedhttp://intranet.mycompany.com.  This allows you to host multiple types of SharePoint sites together on a single web application which ultimately reduces the amount of resources your server farm needs for application pools.

Just like any site collection, you have to create a managed path for the URL you want.  We do this using New-SPManagedPath.  We can add explicit or wildcard inclusions just like you can for path-based site collections.  Wildcard is the default, if you want explicit, include the –explicit parameter.  We also need to add the –HostHeader parameter to indicate this is used with host-named site collections.  Here’s an example, where I created the business-solutions explicit path from our example above.

New-SPManagedPath "managed path name" -HostHeader –Explicit

This technically makes this managed path available on any host-named site collection.  If you want to see what managed paths have been created for host-named site collections, use Get-SPManagedPath with the –HostHeader command.

Get-SPManagedPath –HostHeader

Now, we need to create the site collection using New-SPSite.  It takes a few parameters but the important ones for this scenario is the URL we want for the new site collection and then –HostHeaderWebApplication to specify which web application hosts the new site collection.

New-SPSite “Site collection URL” –HostHeaderWebApplication “host web app URL” -Name "Site collection name" -OwnerAlias domain\user  -Template STS#0


Sunday, December 14, 2014

SharePoint 2013 error – The server was unable to save the form at this error

While working with SharePoint 2013 list, saving the data I got an error saying that “The server was unable to save at this time. Please try again.” As shown the image below.

By checking the logs I have found following error “Memory gates checking failed because the free memory is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.


After verifying the details in event logs, Services and Task Manager Details, I have found that error causing low memory. To fix this error we have to restart “SharePoint Search Host Control” and “SharePoint Administration service”. By refreshing this error we can have a lot of memory will be freed. We have same error when custom application deployed without disposing object. In that case we need to reset the IIS. By resetting the IIS We can save the list data without error.
Hope this helps.


Wednesday, November 5, 2014

SharePoint OWA Power Point error - Sorry, PowerPoint Web App Ran into a problem opening this presentation.

In SharePoint 2013 environment I got an error PowerPoint while previewing the document. Error message states that “sorry PowerPoint web app ran into a problem opening this presentation to view this presentation please open it in Microsoft PowerPoint” as shown the image below.



I am seeing this only one Power Point documents only. Word apps and all the other office are working as expected. By double clicking on the document it is opening as expected.
I have verified ULS logs and IIS logs on trouble shooting this error. I didn’t any information on this error. Tried using fiddler to get any of the information. But no luck. Verified few posts and did following,
  •  Tried to rebuild the Office Web App servers
  •   By passed the host files targeting OWA server
  •  Changed service accounts

All of the options are not worked. Finally one of the post suggested to clear the cache in “d” folder on “C:\ProgramData\Microsoft\OfficeWebApps\Working\d” location in Office Web App server as shown the image below (drive is dependent. In my case it is C:\ If you didn’t find ProgramData, you have set folder option to show the hidden files.)


Go the folder location and remove all the files in the folder (back up all the files instead of deleting). Wow…. It worked like a charm. Almost 3 days I worked on this issue but resolution is this much simple.

Hope this helps..!!!


Wednesday, October 29, 2014

Infopath Error: The Query cannot run, Infopath cannot run the specified query. Access denied.

 Creating a InfoPath form for a document library in one of my project, publish the infopath form I got an error saying that “InfoPath cannot run the specified query. Access is denied”.
I have verified few blog posts and verified following options,
  • Permissions to document library and site – Yes iam having Full Control over site and Document library
  • Domain – Yes iam in VPN with the same network

But User cannot submit a form to SharePoint if the security level is ‘Restricted’ . We need to have Domain Trust should be Full Control or more.
To grant Full control we have to follow the steps below,
In the InfoPath File Click on “Form Options” as shown the image below,



In Form Option popup, Security and Trust, Select “Full Trust” on security level as shown the image below.



Click on Ok to save the settings. Now we can publish the InfoPath form with out errors. 

Tuesday, September 16, 2014

SharePoint content type error “The content type is in use”

One of my project from recent times I was worked on content hub to manage the content types in SharePoint. While changing the content type name, I got an error saying that “The content type is in use” as shown the image below.



I have checked all the content types in current site, I haven’t seen any content type with the current name. By checking few blogs like mavention and sympmarc I got the reasons for this error.

There many reasons for this issue as listed below,

Content type still exists in Site: Even we can’t see the content type in SharePoint content type gallery, it may exists in Recycle Bin (Site Recycle Bin or Site collection Recycle Bin). We have to remove the content type from Recycle Bin too. To remove the content type from Site Collection Recycle Bin, we need to have Site Collection privileges on Site Collection.

Other users might have associated anywhere? There is another chance that other users might have associated with the content type that we can’t see. We can see this behavior in SharePoint document libraries. We can check this by navigating to SharePoint Library settings and click on Manage Check out files. We can see the list of items belongs to other users. If it ok, take the owner ship of the items and check-in them.

Minor Versions:  We have one more possibility that there are some items may checked-in with minor versions in the List/Library. We have to check the appropriate items and need to publish the items with major versions.
This may helps.


Wednesday, September 10, 2014

Check SharePoint service status using SharePoint object model

By using SharePoint object model we can retrieve the User Profile Service information like User Profiles and user group details from UserProfileManager class. Some times we can see “UserProfileApplicationNotAvailable” error. We can check service availability details using following code block.

public bool IsCurrentServiceisInStart(string serviceName)
{
    bool currentServiceisInStart = false;

    SPService currentService = SPFarm.Local.Services.FirstOrDefault(s => s.TypeName.Equals(serviceName));

    if (currentService!= null )
    {
        SPServiceInstance serviceInstance  = service.Instances.FirstOrDefault(i => i.Status == SPObjectStatus.Online);
        If(serviceInstance !=null)
                currentServiceisInStart=true;
    }

    return currentServiceisInStart;

}

We can check the current service from SharePoint local services by mentioning the service application details as “SPFarm.Local.Services.FirstOrDefault” command in Linq.

We can use this code block while calling SharePoint service application. Hope this will help.

Sunday, September 7, 2014

SharePoint custom workflow send email task error: The e-mail message cannot be sent. Make sure the email has a valid recipient

While working with SharePoint custom workflow with Send email task, i am seeing “The e-mail message cannot be sent. Make sure the email has a valid recipient” error in workflow history list every time workflow fired. I was in a confusion that why I am seeing that every time.

Very first time designing workflow I have left all properties for “Send Mail” task empty as I am sending emails through code without interacting any property in Send mail task. I have updated all the properties by creating new Field Properties in the code. But still seeing the same error in workflow history list.

By checking few posts, the error may cause because of two reasons,
  • ·         There is no e-mail in Active directory for system Account.
  • ·         Getting null values for existing properties as not assigning the values.

Here in my case iam getting null values from field properties. So I have updated a dummy email in To field as I am not using the the property anywhere in the code.

Hope this will helps.