Can a naming convention cause MONEY?

February 22, 2012 Leave a comment

We developers who work for different client tend to provide the client name before everything. Example client.projectname.wsp, and try to povide a sitecollection name like /clientcommunity and some go to the extent of providing a internal sharepoint column name like customerconfidentialy (we want to only confidentiality here).

Everyone within the organization knows that it is their community, and administrator know’s it is their package and particularly it does not make sense to append this to a column name. It not only does not make sense, but sometimes when you try to integrate with other systems this lead to real problem and cause money.

Here it is how it may, i was working for a client where they are classifying content in various CMS and also the office documents through document properties. Now we want SharePoint to pickup the content classification automatically from the document property, seems to be a easy one. But this turned to be time consuming, but the property names used in documents & sharepoint are different. And worst is that for some reason they don’t/can’t it in documents.

Now, SharePoint has to create new column and copy the existing values to new column, and verify /ensure this is being pushed to all content types, document libraries and lists.

Why do people give such naming conventions.. :)  does http://intranet.company.com/sites/communities or http://intranet.company.com/sites/<companyname>communities makes sense.. you decide.

 

Categories: Uncategorized

On Premises SharePoint leveraging Cloud

January 12, 2012 Leave a comment

Wish you a very new year to everyone.

Today i was reading a blog which has put a interesting solution by having on premises SharePoint leveraging the services of cloud.

http://sp2010mcs.blogspot.com/2012/01/sharepoint-2010-as-mission-critical.html?showComment=1326141328446

If you are reading this line without reading the article then you might ask ‘why this?’.  You might have internet facing site which might face some unusual increase in load once in year (or may be once in few year) scaling out your servers just for this purpose might increase the cost. But by scaling out through cloud (say windows azure) on demand (as needed) within a reasonable time and pay only for the time you have used.

Interesting, isn’t? . The above link has scaled out by adding additional WFE’s in the cloud.

Most of you might be aware, storage and keeping the performance of  SQL Server is very critical for the success of  SP performance. Above article has induced me to think of moving (or having) on premises SharePoint storage to SQL Azure. Thus reducing the overhead of SQL Maintenance & related operational cost.

This is just a theory, but waiting for my chance to create a business case and implement this.. hope i will get it soon…

 

 

 

 

Categories: Uncategorized

SP1 Upgrade issues

October 27, 2011 Leave a comment

This post is for you if

* Build version was “14.0.5139.5003” before SP1 upgrade

* You get following error “There is no user table matching the input name ‘AllSites’

* Or you get Upgrade object too new (build version = 14.0.5139.5003, schema version = 4.1.7.0). Current server (build version = 14.0.6029.1000, schema version = 4.1.6.0).

Root Cause:

Sometime in May there was a hotfix for a discussion board issue(KB2547226). After this hotfix the Build version of the Config DB will be 14.0.5139.5003 & DB Schema version number is 4.1.7.0. You can check this schema version number on any of the content database table named versions. From one of the error message above it is very clear that this version is greater than what is coming from SP1.

But there are high chances that your admin content database schema version number is 4.1.10.0 (bcose some remedy steps what we attempt makes this possible, but still of no use to us)

Solution:

If you have installed the Hotfix then you don’t have choices.  As of today (11-Oct-2011) there is no supported way to overcome this issue other than modifying the DB directly (i know it is unsupported, but you get this solution even from Microsoft support).

So we have to manually modify the schema version to something lesser than 4.1.7.0   4.1.10.0 (actually to previous version number). It is highly recommended to backup the database before attempting any of these. Please try this in lower environment first (involving premium support is the best thing to do as they might have better solution as days goes on)

IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N’[dbo].[AllSites]‘) AND OBJECTPROPERTY(id, N’IsUserTable’) = 1)

BEGIN

UPDATE Versions SET Version = ‘4.0.148.0’ WHERE Version = ‘4.1.7.0’ AND VersionId = ‘6333368D-85F0-4EF5-8241-5252B12B2E50′

END

Execute the above script on all content databases including admin content database. Don’t execute this on service application db’s & config db’s.  You might have to change the where clause based on the current value.

Once this is executed, run the config wizard and it should get completed successfully.

Hope this helps someone.

Few Tips on CQWP (not from me )

September 22, 2011 Leave a comment
Categories: Customization Tags:

SharePoint Tips

August 4, 2011 1 comment

User Profile Service

  • User Profile Service Sync Service will not start if the databases are on named SQL Server instance.
  • User Profile Service will not work on SharePoint stand alone installation.
  • To make Target Audience feature work, you need to import Groups also as part of the Profile Sync connection
  • It is suggested to run the ‘User Profile Service’ & ‘User Profile Sync Service’ on the same server.

General

Search

$searchapp = Get-SPEnterpriseSearchServiceApplication

$searchapp.SetProperty(“ForceClaimACLs”,1)

Otherwise search will not return results for trusted domain users.

  • Make sure the web application has root site collection otherwise you may have crawling related problems.
  • As part of general maintenace, it is good idea to clear the ‘BLOB Cache’ on WFE servers. In occasional cases it may cause troubles by showing wrong content.
Categories: Uncategorized

Download all the Profile Pictures through Powershell using Web Service

June 3, 2011 1 comment

Scenario:

I got a request from my client to download all the profile pictures of users which is needed for some other team. We don’t have time to write code & move it to production that fast. Hence we are left with the option to download through webservice. Rest goes like this…

You can download the pictures based on the user rights who is downloading. Say if the user has ‘Manage Profiles‘ right on User Profile Service Application then you can browse the profiles by index. By using the approach you need to use ‘NextValue’ provided by ‘GetUserProfileByIndexResult’.  A better explanation is is given here http://markiwaszko.blogspot.com/2007/08/moss-getuserprofilebyindexint-index.html

You can download the powershell script here

The second option is if you don’t have rights on User Profile Service Application, which means you will not be able to use the method ‘GetUserProfileByIndex‘. In this case you need to have list of account names for which you need to download the pictures.

And the same can be downloaded from here

I wanted to use powershell because easy to execute & modify, no compilation is needed and any can see the code so less review effort. This time it was interesting to learn how to use webservices in powershell.

Categories: Uncategorized

SPWebConfigModification Class

May 27, 2011 2 comments

We wanted to use SPWebConfigModification class to modify the web.config of web applications (some entries are made manually already).  Also different entries for different web applications. All these in powershell :)

Here is our important finding before we proceed..

  • The entries which are made in web.config that are not through this class cannot be modified/deleted using this class.
  • You can apply the modification only a particular web application by calling WebAppObject.WebService.ApplyWebConfigModifications() like our last line in the below given powershell
  • Also test to remove the entries through this class to confirm our entries are getting removed safely and to identity possible bugs in making the entries.

-> .

So, clean this mess… we have to first clear those entries manually and then put it back again through SPWebConfigModification. Now i want to read the entries from a xml file so that it easily manageable and easy to ask someone in production to execute it.

<WebConfigModifications>
<!–entry for caching config section–>
<WebConfig>
<NodePath>configuration/connectionStrings</NodePath>
<NodeValue>
<add name=”Caching1″ connectionString=”Initial dd Catalog=Caching;Data Source={Server name};Integrated Security=false;Uid=sqlCachingUser; Pwd=p@ssw0rd” providerName=”System.Data.SqlClient” />
</NodeValue>
<NodeKey>add[@name="Caching1"]</NodeKey>
</WebConfig>
</WebConfigModifications>

Now comes our powershell

Write-Host “Enter WebApplication”
$IURL = Read-Host
Write-Host “Enter Config.xml file name”
$IConfigName = Read-Host
$IWebApp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup($IURL)
Write-Host “Reading the Config.xml file..”
$configFile=[xml](get-content $IConfigName)
Write-Host “Config.xml file read”
[System.Reflection.Assembly]::LoadWithPartialName(“System.Xml”)
foreach($config in $configFile.WebConfigModifications.WebConfig)
{
$Entry = new-object  Microsoft.SharePoint.Administration.SPWebConfigModification
$Entry.Path = $config.NodePath
$Entry.Name = $config.NodeKey
$Entry.Type =[Microsoft.SharePoint.Administration.SPWebConfigModification+SPWebConfigModificationType]::EnsureChildNode
$Entry.Owner = ‘APlainTextisEnough’
$Entry.Value =  $config.NodeValue.get_InnerXml()
$IWebApp.WebConfigModifications.Add($Entry)
}
$IWebApp.Update()
$IWebApp.WebService.ApplyWebConfigModifications()

now execute this powershell script in SharePoint 2010 management shell. Provide the first input as the web applicaiton url for which you want to enter the modifications. And secondly provide the path to .xml file which was stored earlier like .\config.xml.

That’s it.. your modification will reflect only to the web application what you have provided.

[Update 1] If you try to apply a webconfig entry and if that is not going through successfully then most likely that entry remains in configuration database. And when you try to apply webconfig modifications sometime later, the older entry will be still attempted in web.config file. So to check what are the webconfig modifications that are being applied you can check through

$WebApp.WebConfigModifications

Through this, you can see what are the modifications that are being applied, but may not be actually present in web.config file.

Download .xml & powershell file from here

Follow

Get every new post delivered to your Inbox.