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


Tuesday, April 21, 2015

SharePoint 2016…? Yes..!! it is on the way

Most of us are updated from SharePoint 2010 to 2013 recently. But here is another announcement from Microsoft regarding another new update in SharePoint – SharePoint 2016. As per SharePoint office blogs, SharePoint 2016 will be available from 2nd Quarter of 2016. Beta version might be 4th quarter of 2015.

Looks like rein this version Microsoft people most concerned on the customers using on-premises, cloud and hybrid deployments in the future and SharePoint integration with Microsoft Ignite. As per Microsoft people SharePoint 2016 concerned more on better content management, team collaboration and greater UI features all the devices.

Better UI experience: We have to make better and quick decisions to increase the effectiveness of any of the company. SharePoint 2016 provides us improved access to mobile devices to view all the content in SharePoint, permission details on different devices with touch based experience as the more in people-centric. This will be available in SharePoint on-premises and office 365 environments in SharePoint 2016. By using office graph and delve users can able to discover the relevant information stored in on-premises and cloud based environments. In SharePoint 2016, MS people more focused on integrating with Exchange and Yammer applications.

Cloud based infrastructure: SharePoint 2016 designed in the way that experiencing SharePoint on-premises as office 365 and invested more on improving the performance, reliability and scalability on hybrid environment to behave like on-premises environments. With rich UI, improved performance, this will integrate with the next release products such as Windows Servers, exchange server 2016 and next release of SQL server.

Compliances and Reporting: SharePoint server 2016 provides list of features to protect sensitive information introducing Data Loss Prevention. Data Loss Prevention is non-negotiable, and overexposure to information can have legal and compliance implications. With the use of enabling data encryption and compliance tools in on-premises environment and enabling user self-service and ensuring content usage adheres to corporate policy in office 365 environment data will be protected.

There are many things added in SharePoint server 2016. Waiting for most another successful product. Follow me to get more updates.

Source: Office Blogs




Sunday, April 5, 2015

LepideMigrator for Documents – Migration tool for SharePoint, Office 365

Recently I got a chance to explore some of the third party tool to migrate the content form SharePoint, Office 365 sites. LepideMigrator for Documents, one of the best tool to migrate the content from SharePoint. I have seen multiple features to migrate the content from SharePoint, Office 365 environments including Exchange/office 365 public folders.

LepideMigration tool supports both client and server operating systems including WindowsXP/ 7 /8 , Windows server 2003/2003R2/2008/2008R2/2012/2012 R2 for SharePoint 2013 Foundation/Server/ Office environments. It supports all the versions of exchange servers and outlook to migrate the content. You can see the prerequisites and download details here. We have two types of licensing models for this tool. In Subscription License type, we can get the product for a period of time. We have to renew the product license once after the period. Using Perpetual License, we can use the product without expire. For this type we don’t have expiry period.


After installing the tool we can see following screen.




















To work with this tool, we need to have Admin permissions to the user who runs the application. In Exchange server user need access all the mail boxes. To add the site collection the tool, click on Ad New Site under File tab. Right click on SharePoint server, select Add new SharePoint site. This will prompt us Addd new Site window for project name, site address and user credentials details. To enumerate the complete Site Collection, click on “Find Site Collection” button, provide Central Admin URL with username and password details. Click on Next button. At the end tool prompts with another window requesting username and password details to connect the server. Provide username and password, click on Ok to connect the server.

We can get the all the web application details as shown the image below.


Select the web application and click on Next to view all the site collections. Click on Finish button to view the web application and site details as shown the image below.


In the Same way we can connect File system, Public folders by using the options under file tab using the steps shown in this document.

Before starting migration, we can validate the SharePoint site. This is a great feature comes with this tool. We have the option to validate the file size, invalid characters, blocked file types and names and type of the files. After specifying source details, we have to specify the destination where we need to move the files and map the files before running the migration. If we are running the migration for file system to SharePoint site, we can see the dialog box including all the files and folders to migrate to SharePoint.
After checking the tool for some time I have observed lot of features. We got a great tool to migrate the documents in SharePoint, File system and exchange servers. Here are top features,

Universal tool for all migrations:  By using LepideMigrator tool, we can migrate the content form SharePoint, File system and exchange servers.

Analyzing the details before starting migration: As I said earlier, we can validate the SharePoint site/ File system details before starting the migration. We can have the options to validate the details before running migration. We can get the details about the issue that might face in the migration.

Validating data according to SharePoint: We have options to validate the data according the SharePoint. This is one of the feature I like most, you can analise whether the selected content can be uploaded to the SharePoint server or not. You will be able to know what all issues may come during migration.

Migrating metadata: Metadata is responsible for searching for any documents in SharePoint. Customers are very specific about search as they have lot of data on their environment. So we must get the metadata when we are migrating the content. LepideMigrator for Documents helps us transferring attributes not even to file to folder, email, contact etc. also.

Adding multiple sources same time:  By using LepideMigrator for Documents we can connect multiple sources including file servers, office 365 folders, Public folders, mail boxes and achieved mail boxes in the process of migration.

Managing permissions: In SharePoint environments we have lots of private/sensitive data that many of the users are not allowed to see. When migrating the documents from source to destination permissions should not break. LepideMigrator copies the permissions same as source.

Schedule migration:  We can schedule the migration for a specific date, time by using LepideMigrator. Migration will run that time without manual assistance. This reduce the outage for SharePoint site.

Bulk Migration:  Last but not least, this the best feature in LepideMigrator tool. We can select all the files in one click to process bulk migration. This tool will generate .csv file for all the content selected to migrate. 






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.

Wednesday, March 25, 2015

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a.

While working with excel in one of my SharePoint site with excel, I got an error as “Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a” as shown the image below
















This is the issue related to permissions for excel application in the server. We can fix the issue by the steps below.

Open Component services by entering dcomcnfg in Run.

In Component Services navigate to Component Services->Computers->My Computer->DCOM Config->Microsoft Excel Application. Right click and select Properties option as shown below.





























Select “Identity” in top, “Which user account do you want...” section, select “This user” and enter the account having admin control on the machine.


In the security section, Under "Launch and Activation Permissions", Choose "Customize", Click "Edit" button, Add the everyone account and add all the Permissions as shown below.



Do the same thing in "Access Permissions" and "Configuration Permissions". Now we can run excel without errors. 

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


SharePoint 2010 site accessing error - The server is busy now. Try again later

While accessing ee.ihess.com (SharePoint 2010) site, I got the error saying that “The server is busy now. Try again later” as shown the image below.


We can get this error when on the processes/services taking up the bulk of your server resources you can take different actions to reduce this overload (For example: recycling the timer service more often). We have the option to turn off HTTP throttling for an entire web application in Central Administration.
We can fix this error by using the steps below
  • Navigate to Central Admin > Application Management > Manage Web Applications. 
  • Select the problematic Web App > Select the down arrow next to General Settings and click Resource Throttling.

  • On the bottom of the window there will be an option to turn HTTP Request monitoring and Throttling Off. Click OK to save changes.