Month: February 2011

SQL Server – Database Consolidation

As more and more databases come into an enterprise, the question of database expansion and consolidation is often brought to the table.  Capacity expansion costs money, not just software licenses, but also in maintenance and hardware.  At some point there has to be a trade-off between the cost of keeping up performance and storage and the performance of other applications.  This is especially true with the proliferation of SharePoint in many organizations, where the first impulse is to treat SharePoint like a file server which quickly eats through storage space.  However, through database consolidation companies can reduce the number...

Read More

SharePoint | Powershell To Create Personal Site For All SharePoint Users

From time to time I need to set up a somewhat realistic testing environment, especially recently when I’ve been playing around with personal sites and setting up profiled dashboards for different users ( Tech support, IS Manager, Line of Business) in order to test out applying certain pages or webparts to specific roles (Which I don’t really want to run against production just quite yet).  I don’t know how useful this would be in a production environment, however it comes in very handy when I’m setting up test environments and want to fill out the MySite area with a bunch of personal site collections for testing.  I could just set up a replication from production or copy the profile database from production, but this way I don’t even need to touch production to get what I need for testing purposes. The key here is just to run through the User Profile Manager and get all the user profiles in the UPM and then if the Profile’s .PersonalSite property is $Null we go ahead and create the site for them.  At the end, don’t forget to .Dispose the SPSite! I also go through and set up an SP personal admin account to be admin for all personal sites we create.  This is so that later when it’s in production, I can give someone in HR the rights to review everyone’s...

Read More

SharePoint 2010-How to Hide the Ribbon from Anonymous Users and Users without Edit Privileges

In SharePoint 2010 the new ribbon bar (or Fluent UI as they call it) is great when you need to Author a site, but looks rather ugly and “SharePointish” for internet facing sites.  After all who wants to see this at the top of their pages? As such I often have to remove it from the UI.  I have found that the best way to do this is through the CSS style sheets and a little SPSecurityTrimmedControl magic in the site Master Page.  Here are the steps to quickly and easily remove this bar for people who are not authoring on the site: Open your SharePoint master page Locate this line:<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle"> Change it to:<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle" style="display:none"> Now find the end of the “s4-ribbonrow” tag and add following block right after it: <Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddAndCustomizePages"> <script type="text/javascript"> document.getElementById("s4-ribbonrow").style.display = "block"; </script> </Sharepoint:SPSecurityTrimmedControl> Save the new master page and publish And as simple as that, the ribbon bar is now hidden from all visitors who don’t have the ability to edit pages, including those who are coming in...

Read More

SharePoint 2010–Allowing Anonymous Users to Answer Surveys

Recently I was asked to create an anonymous survey in SharePoint.  In many ways these are fairly annoying because SharePoint really wants to know who you are when you’re on the site, so you have to be careful about what features you utilize in your anonymous sites.  However, I think I’ve found a pretty straight forward way of addressing the issue as long as the company is comfortable with creating a separate web application that only allows anonymous access and doesn’t try to authenticate.  This site should only be used to house items that they want to have as...

Read More

SharePoint 2010 – Classic Mode vs Claims Based Authentication

Classic Mode: This is nothing but Windows Authentication (NTLM or Kerberos). In the past, If any web application was created with Classic Mode Authentication then you must extend the web application to a new site if you also want to enable forms based authentication (FBA), and each login (NTLM/FBA) was unique.  To configure this application to use Forms Based Authentication you can convert from Classic Mode to Claims Based. But, there is no UI exist for doing this conversion. The only way around is through PowerShell. $app = get-spwebapplication "URL" $app.useclaimsauthentication = "True" $app.Update() if an application is created using Claims based and if you want to convert from Claims based to Classic Mode then it is not possible either through UI or through PowerShell. Claims Based: In SharePoint 2010 for a web application we can enable both windows, forms authentication. In earlier implementation to do this, we have to create two web applications which has different zones and different authentication. But, with the new claims based authentication a single application can have the capability to configure both windows and forms under single URL. All this is possible because of the authentication framework is built on Microsoft Identify Foundation. And it uses “Geneva” framework to handle this...

Read More

SharePoint Spellchecker Web Service

Microsoft.SharePoint.Publishing object has a great little WebService, http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.spellchecker.aspx The web service is aptly named the Spelling Service and actually leverages code from the Microsoft.SharePoint.Publishing namespace. You can find this WebService on your own SharePoint farm at http://mysite/_vti_bin/spellcheck.asmx. In a nutshell, you simply pass the web service ‘chunks’ of text, and it will identify whether or not any of the words are misspelled. Additionally, you can also specify the language (LCID) or a Boolean flag to auto-detect the language based on the word(s) submitted. Unfortunately, Microsoft is a little vague about this WebService, other than to say it exists and that you can call it… WebServiceBindingAttribute(ConformsTo = WsiProfiles.BasicProfile1_1)] [WebServiceAttribute(Namespace = "http://schemas.microsoft.com/sharepoint/publishing/spelling/", Name = "Spelling Service", Description = "This web service identifies spelling mistakes and recommends suggestions for correction.")] [SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)] public sealed class SpellChecker : WebService When the response is returned, the XML will contain various nodes, which include the index of the text ‘chunk’ where spelling errors appear, the words ‘flagged’ and the type of spelling error that occurred (RepeatWord or UnknownWord). An additional node that you will notice is the offset field, which identifies the location in the input where the misspelled word begins. Lastly, a spellingSuggestions node is also returned which includes the misspelled word and a list of suggestions in the sug node. Sure, there are other spelling web services out there, but if...

Read More

SharePoint 2010 – Cannot get Role Manager with name aspnetsqlroleprovider.

Occasionally I’ll see this error pop up in the EventViewer: Cannot get Role Manager with name <role provider>. The role manager for this process was not properly configured. You must configure the role manager in the .config file for every SharePoint process This will occur after you have configured the Claims based authentication and tried to login to the site using Windows Authentication.  This occurs when you try to login to the site using Forms authentication then you will see above message if and only if you haven’t configured Role Manager correct. In my case I am using Sql Server Membership Provider. I have added web.config changes required for all the web applications and in the "Authentication Providers" section of the web application I have given Member ship provider and Role Manager. But, I haven’t configured Role Manager at all. The solution will be either remove the Role Manager entry in the Authentication Providers section or configure Role Manager correctly. In my case I am not using any roles, so I removed the name from authentication providers and everything started working...

Read More