Tuesday, November 6, 2012

Disable beeping for remote desktop

I have the following environment:
VMware Windows 2008 labs on vSphere. I'm connecting to them using Remote desktop.


One day beeping coming from my remote machines became very annoying. I've tried multiple solutions and only the last one helped. But I'll post all of them as it seems they did help some people.

1. Disable sounds for the Remote Desktop connection:

Remote Sound - Do not play

More details here

2. Device Manager - View - Show hidden Devices - Non-Plug and Play Drivers - Beep – Disable. 
I haven't found this option on my lab.

More details here

3. The final solution that helped me. Change registry keys:

[HKEY_CURRENT_USER\Control Panel\Sound]
"Beep"="no"
"ExtendedSounds"="no"

Did it on the lab and restarted after the change.

Wednesday, October 24, 2012

How to suppress SharePoint 2010 ribbon based on permissions


Have you ever noticed how in SharePoint 2010 Owners see the ribbon and can click Site Actions/Browse/Page, and Readers see the ribbon too but there is no any actions or tabs to click and they see dark blue band. In some cases there is nothing else going on up there for Readers. It is wasted real estate!
Owner:
 
Reader:
 
The Reader can use all the extra space for some website goodness!
This is easy to solve.
- Open the master page, find the div tag: <div id="s4-ribbonrow"- Put the following around it: 
<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="ManageWeb"><div id="s4-ribbonrow" …</div></SharePoint:SPSecurityTrimmedControl>

From here

Monday, October 15, 2012

Restarting IIS after installing/removing/upgrading SharePoint solution

Do I need to restart IIS after installing/removing/upgrading solution?

The answer is simple - YES.

Found few articles explaining it:

SharePoint Solution Deploy, retract, upgrade – What causes your SharePoint farm to go offline IISRESET (web server outage)


Deploying a solution

Initially, the package manifest.xml is checked for its content & destination locations. The files specified in the manifest.xml are copied to the locations. After solution files are copied to the target servers, a configuration reset is scheduled for all front-end Web servers; the reset then deploys the files and restarts Microsoft Internet Information Services (IIS). Farm administrators can specify when this occurs (a timer job).
Reference: http://msdn.microsoft.com/en-us/library/aa544500.aspx


Retracting a solution

On each front-end Web server, the following occurs:
- Internet Information Services (IIS) is disabled.
- Files are removed from the system.
- IIS is re-enabled and Microsoft SharePoint Foundation is reloaded when a user browses to a page.

- Farm administrators can specify the time when the retraction takes place.


Upgrading a solution

There are two ways to do an upgrade of a solution. i.e. Replacement and Update. Both inolve a an IISRESET.
Replacements are essentially a retract and optionally removal of a WSP. Then the new version is added and deployed. Causing an IISRESET (twice!).
Updates are essentially a deployment with the same file name but different GUID. SharePoint detects this and retracts the old solution and deploys the new one..causing an IISRESET.
Please note that there is a -local option when deploying a solution, but according to MSDN, this is to be used for troubleshooting purposes.
Reference: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsolution.deploylocal.aspx


Why do we need to restart IIS after copied DLLs into Assembly
We restart the IIS to reset Application pool as lot of things in SharePoint are cached. The alternative option is you can recycle the application pool of the application for which you have deployed the WSP or DLLs

Deploying solutions with no downtime

Found interesting article about deploying solutions with no downtime


The most important attribute we need to remember is the –Local attribute this will only ensure that the solution deployment will only occur on the local server.
Other attributes include:-
  • WebApplication – this will deploy the solution to a specific Sharepoint Web Application
  • GacDeployment – this option allows a solution which contains .NET assemblies to be installed in to the GAC to be installed.
  • CasPolicies – this option allows a solution which contains code access security policies for the assemblies / web parts to be deployed.

Saturday, October 6, 2012

Finding what site definition is used by a SharePoint site

If you're performing SharePoint migration, you might face an issue with custom site definitions (or templates) site are based on. Or you might want to know what out of the bow definition was used for a site.

To find the template there are different options:
  1. Using SharePoint Manager tool [available for 2007, 2010 and 2013.] Download it for free from Codeplex and install it. Then open the SharePoint Manager and connect to the SharePoint site collection. When you click on a specific SharePoint site, on the right side it will show you all the properties available in the SP object model for that site. Find WebTemplate and Configuration values for the site:
  2. If there is no way to install SharePoint Manager or if any other problems, then save the current site as site template [.STP or .WSP extension]. And save it to disk somewhere. Navigate to that location and rename the file to .CAB extension. Extract the CAB file.If it is SharePoint 2007 you will find manifest.xml file that contains TemplateID and Configuration of the site:

    If it's SharePoint 2010 open the folder that ends with "
    WebTemplate" and open Elements.xml. Find BaseTemplateName and BaseConfigurationID in the file:



     Navigate to end of this post for the TemplateID to Name mapping.
  3. Through managed code we can identify this very easily with the below code:

    view plaincopy to clipboardprint?
    using (SPWeb web = site.OpenWeb("/"))
    {    
       string templateID = web.WebTemplateId.ToString();
    }
  4. Using STSADM.EXE. It needs high level permissions. Means the user should be an administrator on the server. Below is the command we need to use for knowing the site template.
    stsadm.exe -o enumallwebs -databasename [content database name]
  5. Using SQL Management Studio you can execute the below query on the content database of the site collection.
    SELECT Title, WebTemplate, ProvisionConfig FROM dbo.Webs WHERE Title='Test Publishing Site'

Choose one option which is useful or easy for you and identify the correct template.


Site template ID to Name mapping:
0 - GLOBAL (SetupPath=global) - "Global template"
1 - STS - "windows SharePoint Services Site", STS#0 - "Team Site", STS#1 - "Blank Site", STS#2 - "Document Workspace"
2 - MPS - MPS#0 - "Basic Meeting Workspace", MPS#1 - "Blank Meeting Workspace", MPS#2 - "Decision Meeting Workspace", MPS#3 - "Social Meeting Workspace",  MPS#4 "Multipage Meeting Workspace"
3 - CENTRALADMIN - "Central Admin Site"
4 - WIKI - "Wiki Site"
7 - BDR - "Document Center"
9 - BLOG - "Blog"
20 - SPS (OBSOLETE) - "SharePoint Portal Server Site"
21 - SPSPERS - "SharePoint Portal Server Personal Space"
22 - SPSMSITE - "Personalization Site"
30 - SPSTOC (OBSOLETE) - "Contents area Template"
31 - SPSTOPIC (OBSOLETE) - "Topic area template"
32 - SPSNEWS (OBSOLETE) - "News area template"
33 - SPSNHOME (SubWebOnly) - "News Home template"
34 - SPSSITES - "Site Directory area template"
36 - SPSCOMMU (OBSOLETE) - "Community area template"
38 - SPSREPORTCENTER - "Report Center Site"
39 - CMSPUBLISHING (SubWebOnly) - "Publishing and Team Collaboration Site"
40 - OSRV  - "Shared Services Administration Site"
47 - SPSPORTAL - "Corporate Intranet Site"
50 - SRCHCEN - "Search Center"
51 - PROFILES - "Profiles"
52 - BLANKINTERNETCONTAINER - "Internet Presence Web Site"
53 - BLANKINTERNET (SubWebOnly)BLANKINTERNET#0 - "Publishing Site", BLANKINTERNET #1 - "Press Releases Site", BLANKINTERNET#2 - "Publishing Site with Workflow"
54 - SPSMSITEHOST - "My Site Host"
56 - ENTWIKI - "Enterprise Wiki"
90 - SRCHCENTERLITE (SetupPath=SiteTemplates\SRCHCENTERLITE) - "Search Center Lite"
6221 - PWA (SetupPath=SiteTemplates\PWA) - "Project Web Access Site"
6215 - PWS (SetupPath=SiteTemplates\PWS) - "Project Workspace"
14483 - OFFILE - "Records Repository", "Records Repository"


Tuesday, October 2, 2012

SharePoint site templates vs site definitions.

Site Template
  • A site template (*.stp file) is created through the user interface or through implementation of the object model. It is a package containing a set of differences and changes from a base site definition.
  • The site template package is stored as a CAB-based file that can be downloaded or uploaded to site collections by users with the appropriate rights. As before, site templates offer a measure of portability to SharePoint Applications.
  • It is not as fast as a pure site definition as site definitions are cached on start of IIS on the web front ends while site templates are stored and hence need to be fetched from the content database and merged with the site definition code at runtime to render the site.
  • Also note that if you plan to transfer a site template to separate farm, that the farms have the same versions installed of SharePoint installed.  (hotfixes,etc.) This is due to the dependence site templates have on the original base site definition they were created from.
Site Definition
  • The core definition of what a site is in SharePoint.
  • It is installed on file system of web front ends, located at ..\12\Template\SiteTemplates. This directory is language-neutral.
  • It consists of .aspx pages and .xml files with Collaborative Application Mark-up Language (CAML).
  • A major benefit is that the Page and List definition is read locally from the file system, not from Content Database.
  • A site definition Page and List definition are cached at the IIS process start up
  • Customizations made to site definition are stored in content database, not on the file system. This can be performed via SharePoint Designer, or when custom site templates are saved.
  • Site Definitions are developer created
  • Localization: WSS 3.0 supports full site template localization (based on ASP.Net 2.0 via XML files and .ASPX files pulling strings from RESX files. Therefore solutions can be shipped “language packs” of resource files.
  • “Global Template” defines commonality across site definitions; it gets called before any other template. It works by injecting common provisioning content into all new sites. ONET.XML file defines base types, galleries, mobile redirects
  • Data is stored directly on the Web servers, so performance is typically better.
  • A higher level of list customization is possible through direct editing of a Schema.xml file.
  • Certain kinds of customization to sites or lists require use of site definitions, such as introducing new file types, defining view styles, or modifying the Edit menu.
  • Customization of site definition requires more effort than creating custom templates.
  • Editing a site definition after it has been deployed is difficult.
  • Doing anything other than adding code can break existing sites.
  • Users cannot apply a SharePoint theme through a site definition.
  • Users cannot create two lists of the same type with different default content.
  • Customizing site definitions requires access to the file system of the front-end Web server.
  • Custom templates are easy to create.
  • Almost anything that can be done in the user interface can be preserved in the template.
  • Custom templates can be modified without affecting existing sites that have been created from the templates.
  • Custom templates are easy to deploy.
  • Custom templates are not created in a development environment.
  • Custom templates are less efficient in large-scale environments.
  • If the site definition on which the custom template is based does not exist on the front-end server or servers, the custom template does not work.

Custom site definitions hold the following advantages over custom templates:

  • Data is stored directly on the Web servers, so performance is typically better.
  • A higher level of list customization is possible through direct editing of a Schema.xml file.
  • Certain kinds of customization to sites or lists require use of site definitions, such as introducing new file types, defining view styles, or modifying the Edit menu.


Site definition disadvantages include the following:

  • Customization of site definition requires more effort than creating custom templates.
  • Editing a site definition after it has been deployed is difficult.
  • Doing anything other than adding code can break existing sites.
  • Users cannot apply a SharePoint theme through a site definition.
  • Users cannot create two lists of the same type with different default content.
  • Customizing site definitions requires access to the file system of the front-end Web server.


Custom templates hold the following advantages over customization of site definitions:

  • Custom templates are easy to create.
  • Almost anything that can be done in the user interface can be preserved in the template.
  • Custom templates can be modified without affecting existing sites that have been created from the templates.
  • Custom templates are easy to deploy.


Custom template disadvantages include the following:

  • Custom templates are not created in a development environment.
  • Custom templates are less efficient in large-scale environments.
  • If the site definition on which the custom template is based does not exist on the front-end server or servers, the custom template does not work.




SQL Collation


A collation itself specifies the rules for how strings of character data are sorted and compared. The rules for sorting data vary depending on the language and locale. For example if you was to use a Lithuanian collation, the letter "Y" would appear between "I" and "J" if sorted. And if using the traditional Spanish collation "ch" would be sorted at the end of a list of words beginning with "c".

More details here

Even within a table you could have different collations. Collation is a column property, therefore you would need to change the collation for each column: http://www.sqlusa.com/bestpractices/changecollation/

From here

Thursday, August 23, 2012

Native SharePoint upgrade from 2003 to 2010/2013



Well, believe it or not, there are still a large number of SharePoint 2.0 users out there. Yes, that is 2.0… as in 2003… as in 9 years old. At this point, those users are contemplating one of two things: start from scratch on 2010, or actually take the time to upgrade their current 2003 environment(s) to 2010 (or even 2013).
Needless to say, the upgrade path from 2003 to 2010 can be a bit overwhelming. Just like all previous majorreleases of the SharePoint product, there is no way to upgrade directly from 2003 to 2010; you must first upgrade from 2003 to the 2007 version. I know it sounds complicated, but before you decide to scrap everything and start from scratch, let’s take a closer look at what’s involved for the upgrade process.Speaking from experience, making the upgrade from 2003 to SharePoint 2010 isn’t really as tough as it sounds.
The most difficult part of the upgrade is having the required hardware and software, as well as space available to backup the environment in case any issues arise during the upgrade. *It may seem obvious to some our readers, but it’s worth noting that upgrading to SharePoint 2010 will take an entire new server utilizing 64-bit hardware.



Friday, April 27, 2012

Read permissions not working


Some possible reasons and solutions:
http://sharepoint.stackexchange.com/questions/6308/access-denied-for-read-only-group
As it turns out, I had modified the master page for the site when it was first created, then never published it to the site. Once the page was published, I was able to access the site with read-only permissions.


http://blog.tylerholmes.com/2008/02/troubleshooting-access-denied-errors-in.html
Based in URL on Access denied page we can gind a list that causes the issue.

Master page gallery has unique permissions and user does not have permissions for it.

Friday, April 6, 2012

Fiddler - troubleshooting HTTP errors


What is Fiddler?
Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

Fiddler is freeware and can debug traffic from virtually any application that supports a proxy, including Internet Explorer, Google Chrome, Apple Safari, Mozilla Firefox, Opera, and thousands more. You can also debug traffic from popular devices like Windows Phone, iPod/iPad, and others.


http://www.fiddler2.com/fiddler2/

Multi-day reoccurring events in SharePoint

I did not know that you're not able to create a multi-day reoccurring event in SharePoint.
There are a lot of discussions  about that.

Basically, as soon as you check "Make this a repeating event", the date field for Start/End Time disappears:

That's valid for both SharePoint 2007 and 2010.

Hmm... how would create an event to show that I have Friday-Sunday off every week for example? Well, it may be not a real case, but the real one is migrating Outlook Calendars to SharePoint.

Friday, February 10, 2012

SharePoint 2010 Web Parts by License Type

The official SharePoint site contains a comparison of the features in each SharePoint 2010 edition but does not include specific details on what web parts are available for each SKU/license type. This is useful to know when choosing between Foundation vs Standard vs Enterprise, as this additional functionality may be a good reason to upgrade (or turn on these features for specific users). It is also useful to know these as a developer or solution architect so you don’t custom develop something that has already been built and tested by Microsoft – something that I often see happen.


http://www.sharepointconfig.com/2010/06/sharepoint-2010-web-parts-by-license-type/