Tuesday, June 14, 2016

SharePoint 2016 on Windows 2012 R2

Finally, I am managed to build and configure the SharePoint 2016 on new shining Windows 2012 R2  with all the best practices like creating the managed account,Service account and AD Security group to configure the SharePoint 2016 Service application.

I have encountered so many issues while configuring the Windows 2012 R2, First I configured the AD CS (certificate  Server) without AD DS. I am not able to install the SP 2016 without AD.

I don't want to go for fresh installation instead , learn how to remove the AD CS through PowerShell Command.

While Installing the prerequisites ,I encountered the error that says I must have .NET Framework 3.5 SP1, I tried to installing the stand alone installer on my server OS Windows 2012 R2. Standalone installer for .NET framework won't work in Windows 2012 R2,then I go with adding new feature option through "Configure your Local Server" panel.

On installing the Visual Studio 2015, on first there was a error that I must have the .net framework 4.5.6.1 Developer Pack.
Upon searching this, I found the solution , restart the server and try the installation. It works like charm.

Here I am going to explore the new possibilities and features on SharePoint 2016.



Friday, June 10, 2016

Site accessible only for Site Collection Administrator

One of the simple questions (seems to be simple at first) has been asked in SharePoint MSDN forum, "How to ensure that a site collection only can be accessible by "Site Collection Administrator".

While doing the brain storming analyse on this topic, my first stop was finding the solution through SharePoint Power Shell.

But lastly I found there is no such cmdlets for this scenario.

Here are the possible workaround for this,

Creating the feature event receiver that will check the currently logged in user belongs to Site collection administrator , if not set the "ReadLock" on the site collection.

This will help the site collection administrator for quick maintenance to be done on the site on peak hours.

Upon activating the feature, Site will be ready to check the currently logged in user is belongs to Site collection administrator or an end user.

On Deactivating lock will be removed for end user.

 public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            SPSite site = properties.Feature.Parent as SPSite;
            SPWeb web = site.OpenWeb();
            if (!web.CurrentUser.IsSiteAdmin)
            {
                site.ReadLocked = false;
             
            }
            else
            {
                site.ReadLocked = true;
            }
         
        }

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
           //Remove the lock for all
         
        }

Approach : 2