Wednesday 31 July 2013

One or more issues preventing successful Content deployment export were detected on this site collection.For more information go to content deployment source status page in Sharepoint 2013

Hi,

Recently an issue was reported to me where my site admins were getting an error "One or more issues preventing successful Content deployment export were detected on this site collection.For more information go to content deployment source status page" while creating content deployment path in central administration.


This issue was happening due to some features activated in source site collection and these features must be turned off in order to proceed further on this. To fix this follow these steps:

1. Login into your source site collection.
2. Go to Site Settings--> Content Deployment Source Status.
3.Here you will find the list of feature to be deactivated.
4. Deactivate these features and then thats it you are now ready to proceed further.


Thanks,
Rahul Rashu

Unable to drag and drop files in sharepoint 2013 document libraries

Hi,

An issue was reported to me where the users were unable to upload files into document libraries by dragging and dropping them on document libraries. This functionality in turn was working fine on Chrome and Firefox latest browsers. The reasons behind is that this functionality requires HTML 5 which is available in latest version of Chrome and Firefox. This is also available in IE 10. However to get this worked in IE 8 and IE 9 Office 2013 needs to be installed which will apply an active X control.

The office 2013 was installed by the users and this issue was confirmed to be resolved.

I hope this will help you out.

Thanks,
Rahul Rashu

Monday 29 July 2013

How to programmatically create mysites of all users of a group in sharepoint 2013

Hi,

Recently a requirement was posted to me where my site admins wanted to create mysites of all users of a sharepoint group programmatically and this requirement was a recurring one. Hence I developed a tool to carry this out. This tool takes two inputs:
1. Site URL (Where the user group is created)
2. Name of the user group.

After this the tool will pick users of the group one by one and will check if mysite for that user exists or not. If not a mysite would be created and a message would be published, similarly in case a mysite exists the same message would be published. Try catch blocks are used to catch and publish and exception message.
The code is as below:

using System;
using System.Collections.Generic;
using System.Web;

using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Server.UserProfiles;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

namespace MysiteCreation
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Please enter the site URL");
                String url = Console.ReadLine();
                SPSite site = new SPSite(url);
                SPWeb web = site.OpenWeb();
                SPServiceContext serviceContext = SPServiceContext.GetContext(site);
                Console.WriteLine("Please enter the group name");
                String groupName = Console.ReadLine();
                UserProfileManager userProfileManager = new UserProfileManager(serviceContext);
                SPGroup group = web.Groups[groupName];
                SPUserCollection users = group.Users;
                foreach (SPUser user in users)
                {
                    if (userProfileManager.UserExists(user.LoginName))
                    {
                        UserProfile uProfile = userProfileManager.GetUserProfile(user.RawSid);
                        if (uProfile.PersonalSite != null)
                        {
                            Console.WriteLine("Mysite Already exists for the user " + uProfile.AccountName);
                        }
                        else
                        {
                            uProfile.CreatePersonalSite();
                            Console.WriteLine("Mysite successfully created for the user " + uProfile.AccountName);
                        }
                    }
                }
                Console.WriteLine("This is completed, please press any key to exit");
                Console.ReadLine();
            }


            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }

}


I hope this will help you out

Thanks,
Rahul Rashu







Sunday 28 July 2013

How to delete orphan sites in Sharepoint 2013

Hi,

Recently an issue was reported to me where my site admins were unable to remove a reference to an orphan site collection in sharepoint 2013. Here are some details of this site collection:

> This site was inaccessible.
> This site was present in central admin --> View all site collections.
> This site was not selectable although viewable in central admin --> delete site collection
> In content database in the table Allsites the field "Delete" was marked as 1 for this site collection
> Remove-SPSite was throwing exception.

To fix this issue we followed a series of steps very similar to Sharepoint 2007.
>We detached this content database from central admin
> The following powershell command was executed to attach it back
Mount-SPContentDatabase "<ContentDb>" -DatabaseServer "<DbServer>" -WebApplication http://SiteName

Thats it and this issue was resolved.

Thanks,
Rahul Rashu

Wednesday 24 July 2013

Conversion job settings cannot be changed after items have been added to the job in word automation services in Sharepoint 2013

Hi,

An issue was reported to me where an exception was coming while my admins were trying to use word automation services to convert some word documents in pdf format. They were constantly facing with this exception :

System.InvalidOperationException was unhandled
  HResult=-2146233079
  Message=Conversion job settings cannot be changed after items have been added to the job.
  Source=Microsoft.Office.Word.Server
  StackTrace:
       at Microsoft.Office.Word.Server.Conversions.ConversionJobSettings.set_OutputFormat(SaveFormat value)
       at WordAutomationService.Program.Main(String[] args) in
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

After reviewing the source code I found following:

                    cJob.AddLibrary(sourceList, destList);
                    ConversionJobSettings settings = rahulJOb.Settings;
                    settings.OutputFormat = SaveFormat.PDF;
                     cJob.Start();
In the highlighted lines it is evident that the job settings were tried to modified after adding source and destination document libraries. The code was modified and the highlighted lines were moved above the
cJob.AddLibrary(sourceList, destList) and the issue was confirmed to be resolved.

I hope this will help you out.

Thanks,
Rahul Rashu