Thursday, December 8, 2011

Installing SharePoint solution under the hood

Great table explaining states during installing/uninstalling solutions:

Central AdminSite/Web Level FeaturesGACWeb.Config14-RootFeaturesSharePoint Config DB, Objects Table – SolutionsSharePoint Config DB, Objects Table – FeaturesWeb App Content DB, Features Table
Add-SPSolutionSolution Added but Not DeployedN/AN/AN/AN/ASolution Definition AddedN/AN/A
Install-SPSolutionDeployed to Web AppInstalled FeatureDLLs AddedSafe Control Entries AddedFeatures AddedSolution Definition Still ExistsFeature Definition AddedN/A
Enable-SPFeatureSolution Still DeployedActivated feature to Site/WebStill ExistsStill ExistsStill ExistsSolution Definition Still ExistsFeature Definition Still ExistsFeature Activation Link Added
Disable-SPFeatureSolution Still DeployedDeactivated feature from Site/WebStill ExistsStill ExistsStill ExistsSolution Definition Still ExistsFeature Definition Still ExistsFeature Activation Link Deleted
UnInstall-SPFeatureSolution Still DeployedUninstalled featureStill ExistsStill ExistsStill ExistsSolution Definition Still ExistsFeature Definition DeletedN/A
UnInstall-SPSolutionRetracted from Web AppUninstalled featureDLLs DeletedSafe Control Entries DeletedFeatures DeletedSolution Definition Still ExistsFeature Definition DeletedN/A
Remove-SPSolutionSolution DeletedN/AN/AN/AN/ASolution Definition DeletedN/AN/A


The above table has been taken from here: Install/Uninstall table

Installing (MSDN)

Uninstalling (MSDN)

Thursday, November 17, 2011

Delete SharePoint orphan site

If you can see the site in database, but not in Central Administration


stsadm -o deletesite -force -siteid e2a114b8-80c9-41f6-87bf-3feddf2ad9b6 -databaseserver DS1 -databasename DB1


http://technet.microsoft.com/en-us/library/cc288016(office.12).aspx

Wednesday, October 26, 2011

Managed Metadata in SharePoint 2010

I've found an excellent explanation of difference between Global and Local term sets:
Local vs Global term sets

The above blog contains the following useful information as well:


SharePoint 2010 Managed Metadata
What is it? 
Why I love it!
Global vs. Local Term Sets
Moving/Copying MMS Instances / Term Stores between Environments 
In Depth Look into the Taxonomy Parts
Creating Managed Metadata Columns


When I've created a new site for testing and added a managed metadata column to a list, I've got the following message: "The required feature is not enabled for this column type".

The following command should be executed:

Enable-SPFeature -id "73ef14b1-13a9-416b-a9b5-ececa2b0604c" -Url <Site-Url>

Refer to the following article for more details.


Wednesday, October 19, 2011

List of installed updates on the server


Want a quick list of hotfixes and service packs that are installed on your Windows PC or Server? By using the Windows Instrumentation command-line interface (WMIC) you can create a quick list. This Tech-Recipe applies to Windows XP Professional, Windows Vista, Windows Server 2003 and Windows Server 2008.


wmic qfe list


To redirect output to text file:


wmic qfe list > hotfixes.txt




from here

Friday, September 16, 2011

SharePoint Configuration Wizard Failing - RPC Server is unavailable


Try ipconfig /flushdns - and if it still does not work, do ipconfig /registerdns


From here: http://karthickmicrosoft.blogspot.com/2011/01/sharepoint-configuration-wizard-failing.html

How to install Application server on windows 2003 without CD

During adding an Application server role to Windows 2003 server it asks for Service pack 2 CD. But I don't have the CD. Originally it was a server with clear W2003 installation and SP2 was installed using .exe package.


The following article I've found helpful: 
http://serverfault.com/questions/280971/installing-iis-on-windows-2003-without-the-windows-cd


It will prompt you for SP2 files first -- these are in your Windows\ServicePackFiles\i386. Then it will prompt you for Windows Server 2003 RTM files -- these are on the CD. You can use any CD -- it does not have to be the same key as the one you've used to install with.

Monday, August 8, 2011

Reportserver for SQL instance

To configurate reportserver for SQL server with an instance:

Monday, July 11, 2011

WPF: XP style for Ribbon application without title bar

Those who decided to use MS WPF Ribbon probably knows that it has an ugly W98 style on Windows XP.

I have found a solution that works for me.
I decided to use Window instead of RibbonWindow for the application, but in this case it has a title bar:


Finally I've found the following post with example how to hide the bar:
http://blogs.msdn.com/b/wpf/archive/2010/08/20/ribbon-browser-application-without-the-title-row.aspx
It's written for the ribbon browser application but it also works for window application.

In comment to the post I've found the easiest way to hide the bar by changing only .xaml file without modifying .cs.
Just add negative margin to the Ribbon control:
Margin = 0,-26,0,0
It will result the following:

Wednesday, July 6, 2011

WIX: Sleep between Custom Actions during installation

If you require to pause your installation between some custom actions, you can use the following:
<Property Id="QtExecDeferred" Value='"ping" -n 15 127.0.0.1'/><CustomAction Id="QtExecDeferred" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>
The QtExec allows to run command line silently.

WIX: How to run Command Line silently

WIX provides a Custom Action that allows to run Command line silently - Quiet Execution Custom Action

You should use it exactly the same way as listed in the WIX example. Just put your command in the Properties value.

<Property Id="QtExecCmdLine" Value='"command" parameters'/><CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>

Make sure the command has double quotes. For example: '"ping" -n 15 127.0.0.1'

Don't forget to add the WixUtilExtension extension during building the msi package.

Farm Admin in SharePoint 2010

When you add a user into Farm Administrators group in SharePoint 2007 it automatically added as db_owner for the config database. So, I assumed SP2010 works the same way, but it does not.

When you add a user into Farm Administrators group it is automatically added into WSS_ADMIN_WPG group only. 

Refer to the following article to find out which permissions the group has.
In few words it has permissions to system folders on the SP server.
The account does not have direct access to SQL databases, so there will be problems for any third party tools which work with SharePoint through API

The difference is that when you're working with SharePoint via Central Administration you're actually working with databases under Application Pool account. But when you're working via API (SharePoint Object Model for example) you're working in the context of the account executing API calls. So, to get the API calls working you should grant direct access to SharePoint databases.


If you do not want to grant direct access to configuration database you can use PowerShell command:
Add-SPShellAdmin –username <String>
The command adds the user to the SharePoint_Shell_Access role. In fact, those users who included in the role have db_owner access to the Configuration database.
To get a list of users included into the group execute the following comm and:
Get-SPShellAdmin
Refer to the following article for details about required permissions to run PowerShell.
Refer to the following article for details about the SharePoint_Shell_Access role.

Also if you receive the error message when using STSADM, that may mean you run it under a Farm Administrator user who does not have direct access to SP databases. The error message is the following:

This operation can be performed only on a computer that is joined to a server farm by users who have permissions in SQL Server to read from the configuration database. To connect this server to the server farm, use the SharePoint Products Configuration Wizard, located on the Start menu in Microsoft SharePoint 2010 Products.

Friday, May 6, 2011

SharePoint works slow for the first time after restart

Ever thought things on ASP.NET were a bit slow the first time accessing them? Many of you are aware that ASP.NET from a web admin perspective know that things have to recompile and things just aren't as fast the first time. In fact some times things are incredibly slow the first time and are incredibly slow. Ever had users say, for some odd reason some times when I hit my SharePoint site it takes 30 seconds to load, then after a refresh it goes sub second, even clearing their cache the page is fast. That's because it's not a user issue, its simply compiling, caching, etc... on the server after an IISReset or app pool reset or worker process cycle.

Read the whole Joel Oleson post

SharePoint web services

It's interesting how SharePoint Web Services works. Will add here useful links and my own comments based on my research.
Useful links:
Getting Started With SharePoint Web Services
The SharePoint web services are implemented in ASP.NET Web Services (ASMX), and you will find the physical files for most of these web services in the "Microsoft Shared" directory under "web server extensions\12\ISAPI" typically located at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI". The admin web service for the Central Administration tool is located in the ADMISAPI folder for which the central administration console contains a virtual directory named "_vti_adm". When a SharePoint site is created it will contain a virtual directory named "_vti_bin" that points to this location. IIS does not contain any application or virtual directories for subwebs, they do however contain mapping to the _vti_bin virtual directory through SharePoint metadata and HttpModules.
List of SharePoint services includes the following:
WSS Web ServicesWeb Reference
Administration Servicehttp://server/_vti_adm/admin.asmx
Alerts Servicehttp://server/_vti_bin/alerts.asmx
Document Workspace Servicehttp://server/_vti_bin/dws.asmx
Forms Servicehttp://server/_vti_bin/forms.asmx
Imaging Servicehttp://server/_vti_bin/imaging.asmx
List Data Retrieval Servicehttp://server/_vti_bin/dspsts.asmx
Lists Servicehttp://server/_vti_bin/lists.asmx
Meetings Servicehttp://server/_vti_bin/meetings.asmx
Permissions Servicehttp://server/_vti_bin/permissions.asmx
Site Data Servicehttp://server/_vti_bin/sitedata.asmx
Site Servicehttp://server/_vti_bin/sites.asmx
Users and Groups Servicehttp://server/_vti_bin/usergroup.asmx
Versions Servicehttp://server/_vti_bin/versions.asmx
Views Servicehttp://server/_vti_bin/views.asmx
Web Part Pages Servicehttp://server/_vti_bin/webpartpages.asmx
Webs Servicehttp://server/_vti_bin/webs.asmx