Pages

Search This Blog

Friday, July 20, 2012

Requested registry access is not allowed


If you are trying to register a new manage account in SharePoint 2013 and getting error
Application error when access /_admin/registeraccount.aspx, Error=Requested registry access is not allowed.  
 at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)    
 at Microsoft.SharePoint.Administration.SPCredentialManager.GetMasterKey(SPFarm farm)    
 at Microsoft.SharePoint.Administration.SPCredentialManager.GetFarmEncryptionKey(SPFarm farm)    
 at Microsoft.SharePoint.Administration.SPCredentialManager.EncryptWithMasterKey(SecureString sstrPassphrase)    
 at Microsoft.SharePoint.Administration.SPEncryptedString.SetSecureStringValue(SecureString sstrValue)    
 at Microsoft.SharePoint.Administration.SPManagedAccount.Update()    
 at Microsoft.SharePoint.WebControls.RegisterAccountControl.BtnSubmit_Click(Object sender, EventArgs args)    
 at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)    
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
 at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
 at System.Web.UI.Page.ProcessRequest()    
 at System.Web.UI.Page.ProcessRequest(HttpContext context)    
 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
 at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Please make sure that apppool user of the central administrator have full access on the following location in registry.
HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\Secure\FarmAdmin

Thursday, July 19, 2012

Configure SharePoint 2013 Project Template in Visual Studio 2012 RC

If you have installed SharePoint 2013 and Visual Studio 2012 RC, but can not see the SharePoint 2013 project template in visual studio, please refer the below steps to setup it.


  •  Select the "Microsoft Office Developer Tools for Visual Studio 2012 RC" from the search result.
  • Add and install the selected component. During installation, it will install other supporting components also.

  • After installation, Install SharePoint Server 2013 Client Components SDK from the following location.

  • You are done now and SharePoint 2013 project template should be available in the visual studio 2012. 




Wednesday, July 18, 2012

Sharepoint 2013 Beta released

Microsoft has officially released the beta version of its Sharepoint Foundation 2013 Preview and Sharepoint Designer 2013. You can follow below links to download the beta versions:

You can also navigate to the below link for details on SharePoint 2013

http://msdn.microsoft.com/en-us/library/sharepoint/jj162979(v=office.15)

Monday, June 11, 2012

SharePoint 15


Microsoft is planning to release the beta version of its new SharePoint avtaar aka SharePoint 15 by this summer, however the actual product may be launched later this year or starting 2013. I have been searching for the new enhancements and new features that Microsoft is planning for SharePoint 15. Below are some key points that I gathered while searching for new features of SharePoint 15.

  • Include an overhauled Client Object Model (COM), "making it easier for UI designers and front-end developers to build compelling visual interfaces."
  • Support a new app marketplace that will create an ecosystem for multitenant apps.
  • Feature a version for education and training called SharePoint Education.
  • Enable workflow looping in SharePoint Designer, eliminating the need for the Visual Studio development environment for that function.
  • Provide authentication via OAuth 2.0, an open standard that provides cross-platform authentication.
  • SharePoint 15 and Exchange Server 15 are both getting additional built-in information-rights-management (IRM) document-protection functionality as part of the base products.
  • Project Online: New Project site to manage lightweight projects.
  • Visio cloud service component.
  • Offer added information rights management in SharePoint Foundation.
  • Support for viewing business intelligence content on Apple iPad devices.
  • SharePoint 2013 Technical Preview Software Development Kit (SDK) is launched and can be downloaded at: http://social.technet.microsoft.com/wiki/contents/articles/8564.sharepoint-2013-technical-preview-interoperability-api-documentation.aspx
  • New SharePoint Apps Marketplace.
    Namespace:
    using  Microsoft.SharePoint.AppManagement
     
  • Support new Database provider. You can attach Database like MSSQL and any other using namespace:
Microsoft.SharePoint.Administration.DatabaseProvider
 
  • Authentication with a service that supports OAuth 2.0 bearer token authentication using namespace:
Microsoft.SharePoint.IdentityModel.OAuth2
 

Sunday, April 22, 2012

SharePoint List Bulk Delete

Hi Friends,

I came through some requirement where I need to delete number of rows on the basis of some condition. Here we have choice of iterating all the list items and match the required condition if matched delete that list record. This is fine when we say its meeting the requirement. But when we look into its performance its not really a good solution. So here we have another very efficient solution of using ProcessBatchData of SPWeb. This batch technique is 10 times faster than list.Delete(i) technique and it minimizes the round trips to DB. Please find a very simple implementation of this you can alter this as per your requirement.


private void button1_Click(object sender, EventArgs e)
        {
            String strSourceList = "Bulk Delete List";//textBox2.Text.Trim();
            String strSite = "http://abcSite:9000/sites/uk/";//textBox1.Text.Trim();
            String strIds = String.Empty;
            try
            {
                if (!String.IsNullOrEmpty(strSite))
                {
                    if (!String.IsNullOrEmpty(strSourceList))
                    {
                        try
                        {
                            SPSite sourceSite = null;
                            try
                            {
                                sourceSite = new SPSite(strSite);
                            }
                            catch { }

                            if (sourceSite != null)
                            {
                                SPWeb sourceWeb = sourceSite.RootWeb;
                                if (sourceWeb != null)
                                {
                                    sourceWeb.AllowUnsafeUpdates = true;

                                    SPList sourceList = sourceWeb.Lists[strSourceList];
                                    StringBuilder sbDelete = new StringBuilder();
                                    sbDelete.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Batch>");

                                    if (sourceList != null)
                                    {
                                        string command = "<Method>" +
                                                         "<SetList Scope=\"Request\">" + sourceList.ID + "</SetList>" +
                                                         "<SetVar Name=\"ID\">{0}</SetVar>" +
                                                         "<SetVar Name=\"Cmd\">Delete</SetVar>" +
                                                         "</Method>";

                                        foreach (SPListItem objListItem in sourceList.Items)
                                        {
                                            sbDelete.Append(string.Format(command, objListItem.ID.ToString()));
                                        }
                                        sbDelete.Append("</Batch>");

                                        string retVal = sourceWeb.ProcessBatchData(sbDelete.ToString());

                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }

Thanks
Prabhat

Publish Content Type in Content Type hub SharePoint 2010

Sometimes we have a requirement where we need to create the content type in hub and publish the same via code. Following are the methods to Publish or Un-Publish the Content Type in Content Type HUB


 public static String PublishorUnPublishedContentType(SPSite hubSiteCollection, SPContentType cType, bool doPublish)
        {
            String sMessage = String.Empty;
            if (ContentTypePublisher.IsContentTypeSharingEnabled(hubSiteCollection))
            {
                ContentTypePublisher publisher = new ContentTypePublisher(hubSiteCollection);
                try
                {
                    if (doPublish)
                    {
                        publisher.Publish(cType);
                        sMessage = "Content Type Published Successfully.";
                    }
                    else
                    {
                        if (publisher.IsPublished(cType))
                        {
                            publisher.Unpublish(cType);
                            sMessage = "Content Type UnPublished Successfully.";
                        }
                        else
                        {
                            sMessage = "Content Type is not published. You need to Publish the Content Type before UnPublished.";
                        }
                    }
                }
                catch (Exception ex)
                {
                    sMessage = ex.Message;
                }
            }
            else
            {
                // The provided site is not a valid hub site.
                sMessage = hubSiteCollection.Url + ": is not a valid Content Hub Site.";
            }
            return sMessage;
        }

Hope this will help you out !!!!!

Wednesday, April 18, 2012

Free Small Business Site Template for SharePoint 2010

Small Business Template is a SharePoint site definition that can be used as the starter point for publishing your business site on SharePoint 2010. This template provides you a basic set of 5 initial pages that you can increase or edit based on your organization's content. Publishing feature is a pre requisit for this template to work.

 http://code.google.com/p/free-sharepoint-small-business-website-template-theme/

Who benefits from using Small Business Site Template?

Using this template benefits all of the following:
End Users / Administrators – End Users can build their company portal within minutes and then customize the same according to their requirements from the UI itself.
SharePoint Application Developers – Application developers can customize the existing template easily and can update the package to undergo new implementation.

What features does Small Business Site Template offer?

This template provides the following functional features:
  • Rocket-Launch your Website in minutes !!!
  • Ready to use Company portal
  • Support for end to end customization according to own requirements.
  • Customizable Theme
  • Common site content (Header, Footer) customizable by administrator.
  • Easy enhancement support for developers.
  • Publishing as easy as 1-2-3 ! 

Tuesday, April 10, 2012

How to disable mobile views in SharePoint 2010?

It is as simple as adding a new configuration block in web.config of your application

<browserCaps>      <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>      <filter>isMobileDevice=false</filter>    </browserCaps>

Add this setting block anywhere between system.web node.



Saturday, March 31, 2012

Tired of viewing Correlation ID's searching in Log file under 14 hive

In this topic, i would like to cover how you can find out the error details in SharePoint without going into 14 hive and that big log file. There you are not sure what went wrong and you are not much intrested to find what was the issue.

Though, there are couple of 3rd party tools or freewares are available and you can very well use them but this small script will help you to identify the details with the help of the correlation id.

get-splogevent ?{$_.Correlation -eq ""} select Area, Category, Level, EventID, Message
Format-List

Change the GUID with the correlation ID you have got and that's it.