Tuesday, July 11, 2017

DIY vs AWS

Came across a very good , simple to understand comparison between AWS and DIY (Do-It Yourself)


DIY
AWS
Scale Up
Elastic Service(On-Demand/ When needed)
Assume Reliable Infrastructure
Assume Infrastructure Failure
Diverse Technical Expertise
Application Based Expertise
Application Unaware of Infrastructure
Application aware infrastructure
High Upfront Cost
Usage Based Cost
Design, Build, Operate
Limited Knowledge/ Shared Support
Showback , charge back challenging
Showback , Chargeback can be achieved by granular monitoring of usage

AWS vs Azure

Age old question .....

Check this comparison matrix

https://azure.microsoft.com/en-us/campaigns/azure-vs-aws/mapping/




Tuesday, August 02, 2016

Polyglot Solution - Database Scaling

I keep getting question around database scalability and generally seasoned architects have a good idea about scaling the Databases by providing the polyglot solution.

This one is for the newbies who would like to understand more about database scaling, mainly in today's cloud world wherein just using one type of database is not good architecture strategy for prime time rollout of applications for larger audience with huge data exchange potential

If you do a google search "Polygot Persistence" you will get a large number of document detailing the definition

If you are looking for document more technical in nature , download  this document
https://www.microsoft.com/en-us/download/confirmation.aspx?id=40327

Hope you have fun with Polyglotting!!!

Monday, March 30, 2015

Export Term Set to Excel - SharePoint Metadata Services - Powershell Script

# Add SharePoint PowerShell Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

 # File and Directory Location
$dirLocation = "D:\temp\TermStore\"
$date = get-date -Format yyyyMMdd
New-Item ($dirLocation + $date) -Type Directory | Out-Null
$file = New-Object System.IO.StreamWriter(($dirLocation + $date) + "\Terms.csv")

# Connect to site with MMS service connection
$taxonomySite = Get-SPSite -Limit 1
 
# Connect to Term Store in the Managed Metadata Service Application
$taxonomySession = Get-SPTaxonomySession -site $taxonomySite
$taxonomyTermStore =  $taxonomySession.TermStores | Select Name
$termStore = $taxonomySession.TermStores[$taxonomyTermStore.Name]

# Ampersands are stored as full width ampersands within the MMS database.
[Byte[]] $amp = 0xEF,0xBC,0x86

# CSV headers
$file.Writeline("Term Name,Id,Owner,CreatedDate,LastModifiedDate,TermSet,TermSetOpenStatus,GroupName")

# Term counter
$i = 0

foreach ($group in $termStore.Groups) {
    foreach ($termSet in $group.TermSets) {
        foreach ($term in $termSet.GetAllTerms()) {
            [Byte[]] $amp = 0xEF,0xBC,0x86;
            $file.Writeline("""" + $term.Name.Replace([System.Text.Encoding]::UTF8.GetString($amp), "&") + """" + "," + $term.Id + "," + $term.Owner + "," + $term.CreatedDate + "," + $term.LastModifiedDate + "," + $term.TermSet.Name + "," + $term.TermSet.IsOpenForTermCreation + "," + $term.TermSet.Group.Name);
            $i++
            Write-Host -ForegroundColor Cyan  "# Exporting TermSet: " -NoNewline
            Write-Host -ForegroundColor White $termSet.Name -NoNewline
            Write-Host -ForegroundColor Cyan  " Term: " -NoNewline
            Write-Host -ForegroundColor White $term.Name -NoNewline
            Write-Host -ForegroundColor Green " - Done"        
            }          
        }              
    }
$file.Flush()
$file.Close()

Write-Host
Write-Host -ForegroundColor Cyan  "# Exported " -NoNewline
Write-Host -ForegroundColor Green  $i -NoNewline
Write-Host -ForegroundColor Cyan  " terms"

Thursday, January 29, 2015

Wednesday, January 28, 2015

Error while crawling MySite users wherein MySite Web application is set up with SSL

Error Message:

sps3s://www.domain.com/site$$$people/bucketid=1/itemid=539

An unrecognized HTTP response was received when attempting to crawl this item. Verify whether the item can be accessed using your browser. ( WebExceptionStatus: TrustFailure The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.; SearchID = 22908598-2E57-4053-96F5-FBB55B029959 )


Solution:

Ensure the SSL cert is registered under "Manage trust" in SharePoint central Admin


Step 1: Export the SSL Certificate
  •  Open the cert from browser. Click on the lock  in address bar 
  • Go to the tab called “Certification Path”, select the root CA certificate and click “View Certificate”
  • Select the “Details” tab and click on “Copy to file”
  • Save the file in your machine

Step 1: Import it in SP Central Admin


  • Go to SP Central Administration  / Security / Manage Trust. Click on “New”, add the root CA certificate from the local machine 



This should do the trick



Monday, January 05, 2015

User Profile not showing up with proper domain name: User profile sync issues

User are showing up with  different domain name after full profile sync.

For e.g . I have all the users defined in ABC domain but after sync some users are showing up as different domain.

expected users in User Profile : ABC\user1
but showing up as : DEF\user1

Note: There is no domain with name DEF but it still shows up that way.

One of the possible reason is Domain netbios name is different than the FQDN of the domain

Check out article below , section Permission requirements: Domain netbios name is different than the FQDN of the domain

http://blogs.msdn.com/b/russmax/archive/2010/03/20/sharepoint-2010-provisioning-user-profile-synchronization.aspx


Monday, September 08, 2014

New-SPTrustedIdentityTokenIssuer Exception of type 'System.ArgumentException' was thrown

Error Message 

New-SPTrustedIdentityTokenIssuer: Exception of type 'System.ArgumentException' was thrown.

Solutions

Ensure:


  • The name of the SPTrustedLoginProvider is not been using
  • The length of the name is less than 50
  • The certificate is not been using

Wednesday, September 03, 2014

Missing on {ServerName} Error even after patch is Installed

Are you getting an error "Missing on  {Servername}" even after installing the patch?

Something like this ?

Try running the powershell command  Get-SPProduct –local  in the server where the patch is showing up as missing  and if are having good day, it will take care of the issue and on refresh the message will go away


If running the command gives you Goose bumps, than dont worry its just a get operation. More here :
http://technet.microsoft.com/en-us/library/ff607885(v=office.15).aspx




Monday, June 09, 2014

User Profile Service Synchronization Service Stuck in "Stopping" State

1.  stsadm -o enumservices > c:\services.txt - This will provide list of services

2.  stsadm -o provisionservice  -action stop -servicetype "Microsoft.Office.Server.Administration.ProfileSynchronizationService, Microsoft.Office.Server.UserProfiles, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" -servicename FIMSynchronizationService

Thursday, June 05, 2014

User Profile Synchronization Service not Starting - SharePoint 2010

Started my task with lot of excitement to try out cross farm service publishing. Plan was to try  publishing the User profile service, so started configuration for user profile. 

---Tried to add new connection 

Boom...Errorr...User Profile Synchronization Service is not started. Ok. So that's not a big pain right. 

---browsed to services page and clicked on "Start" for user profile synchronization service....

Boom...service stopped. 

---Scratching my head for next hour , google google google ...bing bing bing....

At last one suggestion found , try restarting SharePoint Timer Services

--- Restarted timer services 

Boom ...service started :-)


 

Thursday, March 20, 2014

SharePoint 2010 Site Inventory

If you keep on hearing the question

How can we get inventory of all the site collection/ subsites in a web application including the created and last modified date of these sites.

well you don't have to look for third party tool. Simple old fashioned powershell is  a saviour

Get-SPWebApplication  http://.contoso.com | Get-SPSite -Limit All | Get-SPWeb -Limit All | Select Title, URL, lastitemmodifieddate , created | Export-CSV C:\Inventory.csv -NoTypeInformation


Enjoy!!!

 

Thursday, March 06, 2014

Object Expected JavaScript error in Start Page (start.aspx) - SharePoint 2013


Issue:

After creating new site collection when the user tries to browse main page, following error throws up and screen is stuck in "Working on it ....."  for eternity.....................



Resolution :
Browse to "Site feature" - > Look for "Minimal Download Strategy" - > [Deactivate the feature]


Browse to home page and the scripting error should have gone.....



Wednesday, January 15, 2014

Test host process exited unexpectedly - Failed to queue test run: Unable to start the agent process


Today i was taking session of developer group and talking about the Visual Studio 2013 Test tools. Well it seems they did tried using it and bumped into error("Test host process exited unexpectedly - Failed to queue test run: Unable to start the agent process")  on first trial. 

Well It was a easy fix. As the user was running 64 bit processor based VM, he was geeting an error as Test project setting were set to 32 bit. Just change the test project settings. 

Test-> Test Settings->Default processor Architecture ->Select x64

Tuesday, January 07, 2014

MVC / MVP / MVVM design pattern. What's the difference?

Classic discussion very much prevalent  in architecture community. Though the concepts are quite old now and there are numerous applications build using design patterns, i hear the confusion of these patterns even today.

It's much easier to do white boarding and explain but for some of my readers, i keep getting an email to share an article. Well found one really good webcast from Joe homnick wherein a sample is converted to explain multiple patterns:

Check this out :
http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DPR305 [ Its a old tech end presentation but am sure my readers will appreciate this one]

By the way it also explains the scenario to use such patterns and to my SharePoint geek frds, i hope you are following the MVP.

Let me know your thoughts after listening to this one.




Monday, January 06, 2014

SharePoint 2013 Apps vs SharePoint 2013 Solution

For readers looking for MS article , here is the link. Don't want to take spend your time with my thoughts:
http://msdn.microsoft.com/en-us/library/dn268593.aspx

For readers who are interested and have to time to read my thoughts and provide there 2 cent, read below.....

A lot of organizations are now looking forward to migrate their SharePoint Farm from previous version to SharePoint 2013. But as soon as they start the analysis they bump into multiple new terms, methodology and implementation practices.

One of them which is introduced in SharePoint 2013 in App Model. Well a similar a lean model was tested as "Sandbox Solution" in 2010 version but with least success. It had it's own pain points and developers ended up creating server side controls(Webparts/ User controls).

As word is moving towards cloud platform and concept of applications, SharePoint 2013 took similar route and is now offering App model. Actually it's a pretty smart move. Such framework aligns SharePoint technology in line with open technology which is very much prevalent in today's world wherein there are multiple ways of displaying data(well mobile phone are game changer in today's world) and secondly this approach also takes care of pain of maintenance by SharePoint admin team who were having hard time explaining why the infrastructure is not holding up and tends to break down frequently( Thanks to badly written code by development teams..).

So going to back to question of " do we really need to go app way or should be stick to the old way of coding and deploying in server" .


My take " Though it will take time to learn and implement apps for all the existing customization, it's still worth looking into and converting the most complex ones to SharePoint App, mainly the apps which have longer shelf life in organization"

Read and let me know your thoughts. I understand its not as straightforward and quick for make these changes.

I would like to know the apps you are working which might be a good contender. I am always open for discussion..


Enjoy ..the changing landscape of technology..




Thursday, January 02, 2014

Windows Azure Websites / Cloud Services and VM's Confusion

I keep getting same query from my technology friends and clients on the main difference between  the Windows Azure Website/ Cloud Service and VM's. 

Which one should be considered while rolling out a cloud solution. I understand it can be quite confusing  for a non techie or even for IT management who are not into technology jargons. 

I generally tend to provide the below MS links to understand the difference but the article is still too technical.


So below are my take in simple terms. (Hopefully!!!)

Website Option is for you if :
  • Are you looking for hosting websites with good UI  with simple data transaction which does not deal with high transaction data and probably won't require complex engine in backend business tier.
  • If you don't want want to worry about maintenance of infrastructure(patches..)
  • Would like to have websites which can load balance as per traffic 
  • Provides templates to create websites using wordpress, joompla , droopal .....

Cloud Service (Platform as Service)
  • You can dealing with applications which involves high transaction and required scaled up business tier
  • You need remote access to servers to perform additional configuration e.g.
    • Scripting IIS
    • custom deployment of framework and configuration etc.
  • If you don't want want to worry about maintenance of infrastructure(patches..)
  • Would prefer to have staging and production environment

Virtual Machines ( Infrastructure as service)
  • This option is similar to the server management today done on -Premise. The only difference is that the server is hosted by Microsoft but management of infrastructure and application is your responsibility.
  • This option is good when you are moving your current application as-in in the cloud. The advantage of having VM in azure is that you will get servers on demand up and running in any part of world and won't have to worry about scaling your own datacenters
Now the most important part. COSTING!!!!

Well MS have a neat tool for calculating price. Give it a shot:


Hope this gets your understanding better than when you started reading this article..(I HOPE :-))

Rags


Tuesday, November 19, 2013

Datasource Menu disabled in Dashboard Designer


Are you trying to create a new performance point report but "Datasource" menu is disabled?

The reason of this behavior of absence of App "Dataconnection Library for Performancepoint" 

In order to create this app, Click on Site contents - > Add an App - > "DataConnections Library for PerformancePoint"

Once the App is added, "Datasource" menu will be available.




Monday, November 18, 2013

Unable to connect to SQL Server 2012 Analysis Services from Dashboard Designer (SharePoint 2013)

Are you trying to connect to SQL Server 2012 Analysis Cube using Performance point designer? Are you getting any errors? or it seems as if nothing is happening.

Probably your mind will having multiple thoughts  "What's the problem with this, i hate performance point , What should i even search in google without any error message" ............goes on and on and on

Well i had similar thoughts , till i came across an below article..( Thanks to Omicron)
http://omicron-llama.co.uk/2012/07/18/connecting-to-analysis-services-on-sql-server-2012-from-performancepoint-on-sharepoint-2013-preview/#comment-3864


Cause:
PerformancePoint here isn’t using ADOMD.NET 11, the SQL Server 2012 version

Fix:
Download and install  version 10 of ADOMD.NET installer which comes with the SQL Server 2008 R2


Wednesday, November 13, 2013

How To's SharePoint 2013 ( Apps)

Good samples for all the developers planning to start apps development in SharePoint 2013.

http://msdn.microsoft.com/en-us/library/jj901636.aspx


It probably might feel too much initially but taken a step at a time, makes it much easier to understand and fun to implement.

:-)


Apps are disabled on this site


Created an app and while  deploying the app to portal, visual studio threw and error with failed deployment.

Error:
Apps are disabled on this site

Good thing is there is lots of article our there to resolve this issue. In my case it was lack of basic configuration which needs to be performed before deploying the Apps.


Follow steps, mentioned in link below to avoid this error.

How to: Set up an on-premises development environment for apps for SharePoint



Enjoy Apps.

-Rags

Friday, August 30, 2013

Expand VHD - Increase Capacity of Virtual Hard disk

well, i was stuck with 25 GB of in my virtual hard disk and started my favorite computer operation "Google" to find solution and surprisingly  found one pretty quickly

Here is goes.

Run below command sequentially in command prompt

diskpart                                    [open command prompt and type  this command]
Select vdisk file="Path of VHD"
list vdisk
expand vdisk maximum=40000                    [Size in MB]
attach vdisk
list disk
Online Disk
list volume
select volume                         [Select disk volume to be exteded]
extend
List Volume
detach vdisk
exit

Wednesday, July 17, 2013

SPHierarchyDataSourceControl changes is not reflecting in tree view control


You get a simple requirement
Hide some of the components from Tree view control of SharePoint 2010. ( Though hiding specific items is still not supported out of box and you probably will have to use custom tree view control)

Solution:
Make changes to master page specifically to node "SPHierarchyDataSourceControl "

You can add following properties:
IncludeDiscussionFolders="false"
ShowDocLibChildren="false"
ShowFolderChildren="false"
ShowListChildren="false"


You make changes and refresh page to see the change and to your surprise tree view doesn't change at all and still showing all components. Now you feel changes in your blood pressure and probably thinking what shoud i do next ....


Well probably if you find this article you will save some some of artery damage due to high pressure :-).

Details are give in below link
http://support.microsoft.com/kb/2558891

In nutshell, SharePoint 2010 feature(Metadata Navigation and Filtering Feature)  generally overrides your master page settings, To get this working change the ControlId of Delegate Control that wraps the SPHierarchyDataSourceControl from TreeViewAndDataSource to    TreeViewAndDataSourceCustom.


Relief!!!



Friday, May 24, 2013

People Picker Control - SharePoint 2010 ( Customizing Search Results)

For customizing search results in people picker configured for Windows Authentication in Classic Mode or claims mode check below link
http://technet.microsoft.com/en-us/library/gg602075(v=office.14).aspx


To customize search results in people picker configured in different authentication mode, you need to define custom claims provider:
http://technet.microsoft.com/en-us/library/gg602068(v=office.14).aspx#about








Thursday, May 23, 2013

WSS_Logging DB SharePoint 2010 ( Usage Reporting)

SharePoint 2013 is out  but i still get the queries regarding the usage reporting capability of SP 2010.

Some pointers below.

  • The data displayed by SharePoint Web Analytics is pulled from "WSS_Logging" database. It aggregates all of the raw logging data accumulated in the text files under the 14 hive and imports it into logging database. 

  • Web Analytics Service Retention Policy 


          To persist the usage data in WSS_Logging for longer time you can change the retention policy
           by  changing the settings in central administration

          Central Administration - > Application Management - > Manage Servcie Application
          - >Select Web Analytics Service ->Click "Properties" in ribbon ->Change Data Retention
          Period up  to 25 months.


  • The data import from Logs files to Database is performed by Timer Job " Microsoft SharePoint Foundation Usage Data Import"
         You can set the frequency of timer job depending on load on your server.



  • More Information on Logging DB can be found at : 

          http://technet.microsoft.com/en-us/library/hh769360(v=office.14)

Wednesday, May 01, 2013

Implementing SharePoint DR (SQL Server Log Shipping Method)

Great article on SharePoint DR implementation using SQL Server Log Shipping.

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



Thursday, April 18, 2013

TagCloud Webpart not available SharePoint 2010

Do you feel like breaking your head is less painful than looking for Tagcloud webpart ?.

Well than don't worry your head is probably safe is you haven't yet given  up searching :-)


Just Activate the PortalLayouts feature

stsadm -o activateFeature -name "PortalLayouts" -url "http:///sites/" -force

Wednesday, April 17, 2013

Usage Data Retention in SharePoint Database - SharePoint 2013

Check the current retention policy using :
Get-SPUsageDefinition

By default it's 14 days.

To change the retention use the following script:

Set-SPUsageDefinition -Identity "Page Requests" -DaysRetained 31


Complete definition of this command can be found at :
http://technet.microsoft.com/en-us/library/ff607542.aspx


Wednesday, March 27, 2013

SharePoint 2010 WSP BackUp

Simple script but very helpful considering the fact that it's easy to mess up and than end up trying to find  old WSP in your source control tool. (If your team has been updating the source control :-)).


Always take WSP backup from SharePoint Farm before you deploy revised one.


$farm = Get-SPFarm
$file = $farm.Solutions.Item("{WSPNAME}.wsp").SolutionFile
$file.SaveAs("C:\Backup\{WSPNAME}.wsp")



-Rags

Friday, February 15, 2013

Claim Based Security explained in real simple way

Check this article if you are trying to understand claims based security
http://msdn.microsoft.com/en-us/library/ff359108.aspx


Sunday, February 10, 2013

Office Web Apps and SharePoint Services(Excel, Word, Powerpoint Services)

I always get queries from peers and clients on difference between SharePoint 2010 and Office Web Apps. They are completely different component. Office Products have tight integration with SharePoint using the Office Web Apps feature installed in SharePoint.

Note : You can run Office Webs Apps using Office Web Apps server even if you do not have SharePoint in your organization.

Useful Links:

Office Web Apps:
http://technet.microsoft.com/en-us/library/jj219456.aspx


Office Web App Server Planning:
http://technet.microsoft.com/en-us/library/jj219435.aspx

Office Web Apps Deployment :
http://technet.microsoft.com/en-us/office/ee815687.aspx

Office Web Apps platform comparison
http://technet.microsoft.com/library/ff925944(office.14).aspx

Excel Services vs Excel Web App
http://blogs.technet.com/b/tothesharepoint/archive/2010/07/21/excel-services-and-excel-web-apps-common-different-features.aspx

Licensing
http://office.microsoft.com/en-us/buy/microsoft-office-volume-licensing-suites-comparison-office-FX101825637.aspx




Tuesday, January 15, 2013

Detect Content DB orphans and delete in a SharePoint 2010 Farm thru Windows PowerShell


Detect orphans in Content DB:

SCRIPT
----------------------------------------------------------------------------------------------------------------------------------
if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) 
     {Add-PSSnapin Microsoft.SharePoint.Powershell}
       set-location "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN"
         $SPFarm = Get-SPFarm
           $contentWebAppServices = (Get-SPFarm).services | ? {$_.typename -eq "Microsoft SharePoint Foundation Web Application"} 

               foreach ($SPWebApp in $contentWebAppServices.WebApplications)
                 {
                   foreach ($SPSite in $SPWebApp.Sites)
                     {
                       Write-Host "Going thru Site Collection" $SPSite.Url
                         $SPSite.Url >> C:\SPSiteOrphanObject.txt
                           stsadm.exe -o databaserepair -url $SPSite.Url -databasename $SPSite.ContentDatabase.Name >> C:\SPSiteOrphanObject.txt
                             $SPSite.Dispose()
                               }}
                              ----------------------------------------------------------------------------------------------------------------------------------
                              • To delete orphan objects from a particular site use following script 
                              if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) 
                               {Add-PSSnapin Microsoft.SharePoint.Powershell}
                               set-location "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN"
                              stsadm.exe -o databaserepair -url -databasename  >> C:\SPSiteOrphansDelete.txt

                              Note
                              • You can get the Content DB of a particular site collection using below script
                              $site=Get-SPSite
                              write-host $site.ContentDatabase.Name
                              
                              
                              
                              
                              
                              

                              Monday, September 17, 2012

                              Service Unavailable – HTTP Error 503. (SharePoint 2010)

                              When you try to load the page you probably might end up with following error:
                              Service Unavailable – HTTP Error 503

                              First Shot

                              Check Application Pool, most probably it will be turned off. Turn it on and test the portal.


                              If App Pool shuts down once more than

                              Second Shot 


                              Check the eventvwr
                              I had following error message:(not pasting the whole message but the important pointer)

                              The exception message is: Exception has been thrown by the target of an invocation.. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The farm is unavailable. at Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.


                              If your error message is same as mine then try this resolution:

                              Open Application Pool - > Advanced Settings - > Enable 32 Bit Application and Set to FALSE


                              Hope that fixes your error.

                              Have Fun!!!




                              Tuesday, September 11, 2012

                              Admin SVC must be running in order to create deployment timer job

                              Error

                              This error message pops up when solution is installed using powershell command

                              Install-SPSolution -identity test.wsp -webapplication http://test/

                              Resolution

                              Method 1:
                              Go to Administrative Tools > Services and browse to find “Sharepoint 2010 Administration”.
                              Start  Service

                              Method 2:
                              Start-Service SPAdminV4





                              Error Deploying WSP using Visual Studio 2010

                              Issue:

                              Error occurred in deployment step 'Activate Features': Feature with Id  is not installed in this farm, and cannot be added to this scope.


                              Resolution:
                              This is mainly due to inability of Visual Studio 2010 to deploy solution in farm.try deploying the WSP using powershell command in each web front end SharePoint server in farm.

                              Check this article:
                              http://blogs.msdn.com/b/calvarro/archive/2011/11/06/sharepoint-2010-amp-visual-studio-2010-error-ocurred-activate-features-feature-with-id-installed-in-this-farm-cannot-be-added-to-this-scope.aspx

                              Wednesday, July 11, 2012

                              Storing values in SharePoint 2010 Property Bag

                              Property bags?
                              Property bags are place to store metadata or properties.The property bags are implemented as hash table consisting of property names and values.

                              Property bags can be defined at following levels:


                              • Farm (SPFarm class) 
                              • Web application (SPWebApplication class) 
                              • Site collection (SPSite class) 
                              • Site (SPWeb class) 
                              • List (SPList class)


                              Property bags can be set using SharePoint designer and programmatically.

                              Using SharePoint Designer 2010:

                              • Open Site in SharePoint Designer 2010
                              • Go to Site->Site Options
                              • Click on Parameters tab where you can see the list of existing properties, from the same place you can even perform add/modify/remove actions.


                              Programmatically

                              To Read the Set Key:


                              SPSite siteCollection = new SPSite("");
                              SPWeb website = mySite.RootWeb;
                              string MyValue = website.AllProperties["KeyName"]);

                              To Set the Value
                              SPSite siteCollection = new SPSite("  ");
                              SPWeb website = mySite.RootWeb;
                              website.Properties.Add(" KeyName ", "KeyValue");
                              website.Properties.Update






                              Monday, June 25, 2012

                              Adding DLL to WSP SharePoint 2010

                              In order to add custom dll to WSP Package , follow these steps:

                              • Create new Empty SharePoint Project 
                                • File->New->Project->SharePoint(2010)->Empty SharePoint Project 
                                • In second screen provide test site URL
                                • Select "Deploy as Farm Solution"

                              • Expand package node and double click on Package.package file 




                              • Click on "Advanced" Tab



                              • Add the Custom dll's using the "Add" button



                              • Save the project, compile and deploy. Custom dll will be part of WSP.

                              Enjoy!!!!

                              Rags

                              Wednesday, June 13, 2012

                              SharePoint Foundation 2010 Best Practice

                              Sandbox Solution Capabilities

                              Complete Article :http://msdn.microsoft.com/en-us/library/ee231562.aspx

                              In Nutshell


                              Sandboxed solutions support the following capabilities and elements:

                              Content Types/Fields

                              Custom actions

                              Declarative workflows

                              Event receivers

                              Feature callouts

                              List Definitions

                              List Instances

                              Module/files

                              Navigation

                              Onet.xml

                              SPItemEventReceiver

                              SPListEventReceiver

                              SPWebEventReceiver

                              Support for all Web Parts that derive from System.Web.UI.WebControls.WebParts.WebPart

                              Web Parts

                              WebTemplate feature elements (instead of Webtemp.xml)

                              Visual Web Parts

                              Sandboxed solutions do not support the following capabilities and elements:

                              Application Pages

                              Custom Action Group

                              Farm-scoped features

                              HideCustomAction element

                              Web Application-scoped features

                              Workflows with code



                              Monday, June 11, 2012

                              Get Machine Name and IP ASP.NET

                              My previous post has an function which is now deprecated.
                              http://metahat.blogspot.com/2009/09/get-client-machine-name-aspnet.html
                              System.Net.Dns.GetHostByAddress(Request.UserHostAddress).HostName


                              Following are the new function to get client machine name and IP address:

                              string[] computer_name = System.Net.Dns.GetHostEntry(Request.ServerVariables["remote_addr"]).HostName.Split(new Char[] { '.' });
                                                      
                              string machineName=computer_name[0].ToString();
                              string ipAddress  =Request.ServerVariables["REMOTE_ADDR"].ToString();

                              Wednesday, June 06, 2012

                              Powershell Commands (Mostly Used)

                              Here is collection of commonly used powershell cmdlets.
                              More details :
                              http://technet.microsoft.com/en-us/library/ee906565.aspx

                              Add-SPSolution(Uploads a SharePoint solution package to the farm.)
                              Add-SPSolution -LiteralPath c:\contoso_solution.wsp

                              Remove-SPSolution(Removes a SharePoint solution from a farm.)
                              Remove-SPSolution -Identity contoso_solution.wsp

                              Install-SPSolution(Deploys an installed SharePoint solution in the farm.)
                              Install-SPSolution -Identity contoso_solution.wsp -GACDeployment

                              Uninstall-SPFeature(Uninstalls an installed feature definition.)
                              Uninstall-SPFeature -path "MyCustomFeature"

                              Add-SPUserSolution(Uploads a new sandboxed solution to the solution gallery.)
                              Add-SPUserSolution -LiteralPath c:\contoso_solution.wsp -Site http://sitename

                              Disable-SPFeature(Disables an installed SharePoint Feature at a given scope.)
                              Disable-SPFeature –identity "MyCustom" -URL http://somesite

                              Enable-SPFeature(Enables an installed SharePoint Feature at the given scope.)
                              Enable-SPFeature –identity "MyCustom" -URL http://somesite

                              Get-SPFeature(Returns the SharePoint Features based on a given scope)
                              Get-SPSite http://somesite | Get-SPWeb –Limit ALL |%{ Get-SPFeature –Web $_ } | Select DisplayName,ID -Unique

                              Install-SPFeature(Installs a SharePoint Feature by using the Feature.xml file.)
                              Install-SPFeature -path "MyCustomFeature"

                              Uninstall-SPFeature(Uninstalls an installed feature definition)
                              Uninstall-SPFeature -path "MyCustomFeature"


                               

                              SharePoint 2010 101 Code Samples

                              Monday, June 04, 2012

                              Error while Installing SharePoint Foundation 2010 to Win 7 Desktop

                              Error:
                              Setup is unable to proceed due to following error(s):
                              This product required Windows Server 2008 Service pack 2 or above.
                              Correct the issue(s) listed above and re-run set up.

                              Solution:
                              In Order to install SharePoint 2010 Foundation/Office Server 2010, you need to make changes to configuration settings.

                              Refer article below:
                              http://msdn.microsoft.com/en-us/library/ee554869.aspx

                              -Rags

                              Friday, June 01, 2012

                              Deploying SharePoint 2010 Package using VS 2010

                              Well today i created a solution package and tried to deploy it to SharePoint 2010 portal hosted in separate server.Though it sounds such a straight forward step, i managed to get a nice long error message stating :


                              Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project

                              So i was back to my favorite page "google.com". (Not sure what would have been life of a techi if search engines would not had been there ;-) .)

                              So i came to know that currently Visual Studio 2010 only supports deployment of packages to locally installed SharePoint instance.So no remote support yet.

                              if you want to deploy to remote server than there are multiple ways to achieve this one :
                              http://msdn.microsoft.com/en-us/library/aa544500(office.14).aspx



                              Error while deploying package using Visual Studio 2010 to SharePoint 2010

                              Errors
                              Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.

                              OR


                              Error occurred in deployment step 'Recycle IIS Application Pool': The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.


                              Reason

                              The error pops up when userid doesn't have access to configuration and content DB.

                              Resolution
                              There are 2 ways to resolving this issue.

                              Preferable Method(1st method): 
                              Use Power shell command to provide user id access to SharePoint DB's.

                              • "Add-SPShellAdmin -UserName domain\username" This will add permissions to the config database in SharePoint 2010
                              • "Get-SPContentDatabase -WebApplication " This will return information on the content database for the desired web application
                              • "Add-SPShellAdmin -UserName domain\username -database " This will add permissions to the content database for the desired web application



                              2nd method:
                              Add the userid as DBOwner to Configuration and Content DB. Though this is not best practice but will at least get you going.

                              -Rags




                              Tuesday, May 01, 2012

                              Unable to display this webpart error when connected to data using BCS services

                              Well in my case it was a known issue, data throttling. Challenge was not to fix the issue but was to figure out what the issue is .

                              Generic error like "Webpart error" doesn't help.

                              1) First issue was to figure out the issue.

                              Solution :
                              Use ULS Viewer, it's very handy in such situation :
                              http://ulsviewer.codeplex.com/releases/view/19835

                              2) How to throttle the data. This one was a quick one. Pretty good article in this team blog.

                              http://blogs.msdn.com/b/bcs/archive/2010/02/16/bcs-powershell-introduction-and-throttle-management.aspx


                              -Raghu Iyer




                              Thursday, December 15, 2011

                              WF Rule Engine

                              If you are trying to author Rules using the WF rule engine than 2 samples are must for reference . These are old samples but works like charm :


                              Samples :
                              External ruleset toolkit
                              Ruleset analyzer

                              Thursday, October 20, 2011

                              SOAP Request Testing Tool

                              I am been using the SoapUI tool for quite some time and it's pretty impressive.

                              You can get it from :
                              http://www.soapui.org/

                              In order to work with Soap Request which needs authentication , there is a tab "AUT" wherein your can specify credential.
                              http://www.soapui.org/SOAP-and-WSDL/authenticating-soap-requests.html

                              Saturday, October 15, 2011

                              Resource not found 404 error ( WCF Data service hosted with MVC ASP.NET)

                              Scenario: MVC ASP.NET application containing WCF data services. When you try to browse WCF data service .svc page you might get the error
                              "Resource not found -404 error" .

                              Reson for such behavior : When you try to browse to data service page , the request is sent to MVC framework first rather than data service . As the controller is not defined for such request , error is send back.

                              Resolution :Ignore request redirection to MVC framework when WCF data service is requested .In order to achieve this add following to global.asax RegisterRoute function.

                              routes.IgnoreRoute("{resource}.svc/{*pathInfo}");

                              Friday, September 30, 2011

                              System.Data.Entity.DbUpdateException

                              {System.Data.Entity.DbUpdateException: An error occurred while saving entities that do not expose foreign key properties for their relationships. The EntityEntries property will return null because a single entity cannot be identified as the source of the exception. Handling of exceptions while saving can be made easier by exposing foreign key properties in your entity types. See the InnerException for details. ---> System.Data.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.ArgumentException: Parameter value '12.50000' is out of range.
                              at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc)
                              at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
                              at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
                              at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
                              at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
                              at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
                              at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
                              --- End of inner exception stack trace ---
                              at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
                              at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)
                              at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
                              at System.Data.Entity.Internal.InternalContext.SaveChanges()
                              --- End of inner exception stack trace ---





                              Got above error while performing database.save() of Entity Model .

                              The reason for failure was the decimal field in DB which was set for DECIMAL(6,5) whereas the value trying to be saved was 12.00000 .

                              This is how it works :

                              e.g.
                              decimal of (4,1) can hold upto 999.9
                              decimal of (3,1) can hold upto 99.9

                              Tuesday, September 13, 2011

                              Executing Java .jar within .NET

                              using System.Diagnostics;



                              Process process = new Process();

                              //Path wherein Java is installed in your machine
                              process.StartInfo.FileName = "java.exe";
                              //.jar file to be executed
                              process.StartInfo.Arguments = @"-jar Sample.jar";

                              process.StartInfo.UseShellExecute = false;

                              process.StartInfo.RedirectStandardOutput = true;

                              process.StartInfo.RedirectStandardError = true;

                              process.Start();

                              //Get the output from stream
                              Console.WriteLine(process.StandardOutput.ReadToEnd());

                              //in case of no error ExitCode will be zero
                              if(process.ExitCode)
                              {
                              //In case of error , get error description
                              string error = process.StandardError.ReadToEnd();
                              }

                              Console.WriteLine(error);

                              process.WaitForExit();

                              Tuesday, August 16, 2011

                              An entity object cannot be referenced by multiple instances of IEntityChangeTracker.

                              I got this error due to using separate context object for an entity. I had to use same context object to perform multiple operations in Entity .

                              Friday, August 12, 2011

                              Request Error



                              Getting generic request error while browsing ?Set the includeExceptionDetailInFaults = true in web.config in order to get some descriptive error message.














                              Specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider

                              I got this error when i was trying to browse the WCF data Services. The resolution for this issue was to define the connection string for database defined in in app.config file to the web.config file of the web application.

                              In Nutshell , below is my scnerio :

                              Project 1 : Contains the .edmx and app.config file

                              Project 2 : Contains the .SVC referencing entity model defined in project 1 and web.config file

                              Resolution :
                              Copy the Db connection defined in app.config to web.config under configuration section .

                              Thursday, July 21, 2011

                              Format ComboBox ExtJS

                              items: [
                              {
                              xtype: 'combobox',
                              fieldLabel: 'State',
                              store: 'TestStore',
                              queryMode: 'local',
                              displayField: 'State',

                              listConfig: {
                              getInnerTpl: function () {

                              return '
                              {State}:{status}
                              ';
                              }
                              }

                              }

                              Tab Inside a Tab ExtJS

                              Ext.create('Ext.TabPanel', {
                              renderTo: Ext.getBody(),
                              id: 'main-tabs',
                              height: 300,
                              width: 600,
                              activeTab: 0,
                              defaults: {
                              padding: 10
                              },
                              items: [{
                              xtype: 'tabpanel',
                              title: 'Tab 1',
                              id: 'tab1',
                              activeTab: 0,
                              padding: 5,
                              border: true,
                              plain: true,
                              defaults: {
                              padding: 10
                              },

                              items: [{
                              title: 'Sub-tab 1',
                              id: 'subtab1',
                              html: 'Sub-tab 1 content'
                              },{
                              title: 'Sub-tab 2',
                              id: 'subtab2',
                              html: 'Sub-tab 2 content'
                              },{
                              title: 'Sub-tab 3',
                              id: 'subtab3',
                              html: 'Sub-tab 3 content'
                              }]
                              },{
                              title: 'Tab 2',
                              id: 'tab2',
                              html: 'Tab 2 content'
                              },{
                              title: 'Tab 3',
                              id: 'tab3',
                              html: 'Tab 3 content'
                              },{
                              title: 'Tab 4',
                              id: 'tab4',
                              html: 'Tab 4 content'
                              },{
                              title: 'Tab 5',
                              id: 'tab5',
                              html: 'Tab 5 content'
                              }]

                              });
                              });

                              Adding panel to ViewPort (ExtJS)

                              Add Panels to ViewPort on the fly

                              1) Define ViewPort

                              viewport = Ext.create('Ext.container.Viewport', {
                              layout: {
                              type: 'border'
                              },
                              defaults: {
                              split: false
                              },
                              items: [{

                              region: 'center',
                              layout: 'border',
                              frame: false,
                              padding: '0 5 0 0',
                              border: false,
                              items: [{
                              region: 'center',
                              items: [
                              {
                              xtype: 'grid1'
                              }

                              ]
                              }]
                              },


                              {

                              region: 'south',
                              frame: false,
                              padding: '0 5 0 0',
                              border: false
                              }
                              ]
                              });


                              2) Add panel on the fly to defined region. In our example we are adding panel to "South" region

                              southRegion = viewport.getComponent(1);

                              southRegion .add(myPanel);

                              southRegion .setWidth(200);

                              southRegion .doLayout();



                              Tuesday, July 19, 2011

                              Remove Special character from String

                              string Formatted = Regex.Replace(, @"[\-]", "");

                              Regular Expression for YYYYMM

                              Well i managed to make this one for now. If you have better one please share .

                              YYYYMM

                              (^(19|20)\d{2})((0[1-9])|(1[0-2])$)

                              e.g.
                              PASS : 200901 , 201012 ...

                              FAILS :211001 , 200913 ...

                              Sunday, July 17, 2011

                              Timeout Ext.Ajax.request

                              Set :

                              Ext.Ajax.timeout = < millisecond >;

                              e.g.

                              Ext.Ajax.timeout = 90000;

                              Friday, July 08, 2011

                              Get Security Information from Client

                              In order to get the security information from client in a Service , use the following Class :

                              ServiceSecurityContext Class

                              ServiceSecurityContext.Current.WindowsIdentity.Name
                              ServiceSecurityContext.Current.PrimaryIdentity.Name

                              More Information:
                              http://msdn.microsoft.com/en-us/library/system.servicemodel.servicesecuritycontext.aspx

                              Wednesday, June 22, 2011

                              Message: Expected identifier, string or number

                              If you get this error in your Ext JS page , then there is big possibility that you have added a extra comma which is not required .

                              E.g.
                              Incorrect entry
                              {
                              title: 'Main Content',
                              collapsible: false,
                              region: 'center',
                              layout: 'fit',
                              margins: '5 0 0 0',
                              xtype: 'panelbais' , }

                              Correct entry

                              {
                              title: 'Main Content',
                              collapsible: false,
                              region: 'center',
                              layout: 'fit',
                              margins: '5 0 0 0',
                              xtype: 'panelbais' }


                              Check out the last comma before the closing curly braces .

                              Monday, June 20, 2011

                              'undefined' is null or not an object in ext-all.js

                              One more ext-all.js error . This time it was due to extra comma in object literal definition.

                              Resolution :
                              Find and remove extra comma.

                              'flex' is null or not an object in ext-all.js

                              I got this error for quite some time and i had no clue what was wrong in my page . Page consisted of only 2 panel controls . That's all

                              After playing around with some of properties of panel , the issue was resolved.

                              Issue in my case :
                              First panel had property layout: 'anchor'
                              Second Panel had property layout: 'border '


                              Resolution :
                              Changed the second panel property layout: 'anchor'

                              This might not be your case . This error is very generic and can pop up due to multiple reasons .


                              Ext JS : Data Model proxy for Json and XML return type

                              JSON RETURN DATA

                              If you data is returned in JSON format then your proxy for Data Model will look like :
                              Ext.define("Post", {
                              extend: 'Ext.data.Model',
                              proxy:
                              {
                              type: 'rest',
                              url : 'http://xyz.com/ID/18/',
                              reader: {
                              type: 'json',
                              root: 'CUSTOMER'
                              }
                              }



                              XML Return Data

                              Ext.define("Post", {
                              extend: 'Ext.data.Model',
                              proxy: {
                              type: 'ajax',
                              url : 'http://xyz.com/ID/18',
                              reader: {
                              type: 'xml',
                              record: 'CUSTOMER'
                              }
                              },

                              Ext JS Programming Basic Requirement

                              So , if you have started working with Ext JS make sure you are using the following tools . Believe me they are quite handy and saves you from head banging ;-)

                              1) Fiddler
                              2) Scripting client
                              3) REST Service Tested ( Firefox)
                              4) Firebug


                              Thursday, June 16, 2011

                              Could not find default endpoint element that references contract 'x' in the ServiceModel client

                              Scenario :

                              I was creating a WCf client to test the services . After creating client proxy and testing the services i bumped into below error. It seems the configuration in my app.config was not correct.

                              ERROR:
                              {System.InvalidOperationException: Could not find default endpoint element that references contract 'x' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.


                              Resolution :
                              When you generate client using the svcutil.exe , an output.xml is generated. This file contains the end point configuration information . Take the configuration from this file and add it to app.config. Service should work without configuration issue assuming your code is not erroneous ;-)


                              Wednesday, June 15, 2011

                              Visual Studio IntelliSense to show comments for the Custom Function

                              If you added Summary to your custom defined function and it's still now showing description as part of Visual Studio IntelliSense then for sure you are missing a setting .

                              e.g.

                              ///<summary>
                              This is test function
                              ///</summary>

                              public void TestFunction()
                              {
                              //Do something...
                              }



                              when you access this function , you expect the description to show up but in case its shows nothing . Then do this :

                              1) Open Projects property page
                              2) Click the Build Tab
                              30 Check the "Xml documentation file " checkbox


                              Compile project and try once more ...



                              Wednesday, June 08, 2011

                              Accessing Enterprise Application Blocks

                              There are mutiple ways to access application blocks :

                              Using the Enterprise Library Service Locator

                              var writer = EnterpriseLibraryContainer.Current.GetInstance();
                              writer.Write("I'm a log entry created by the Logging block!");


                              var customerDb
                              = EnterpriseLibraryContainer.Current.GetInstance("Customers");


                              The Sophisticated Approach — Accessing the Container Directly

                              var theContainer = new
                              UnityContainer().AddNewExtension();


                              var writer = theContainer.Resolve();
                              writer.Write("I'm a log entry created by the Logging block!");

                              var customerDb = theContainer.Resolve("Customers");



                              Check out this diagram :
                              http://msdn.microsoft.com/en-us/library/Ff953191.441da4ba-fa2e-4da3-bac1-89897580d80b(l=en-us,v=PandP.50).png

                              Wednesday, December 08, 2010

                              Prism with Silverlight : Short Videos but covers topic really well

                              Creating a shell and modules
                              http://channel9.msdn.com/blogs/akmsft/creating-a-modular-application-using-prism-v2-part-1-of-4--creating-a-shell-and-modules

                              Visual Composition
                              http://channel9.msdn.com/blogs/akmsft/creating-a-modular-application-using-prism-v2-screencast-24--visual-composition

                              Implementing views and services
                              http://channel9.msdn.com/blogs/akmsft/creating-a-modular-application-using-prism-v2-screencast-34--implementing-views-and-services


                              Decoupled Communication
                              http://channel9.msdn.com/blogs/akmsft/creating-a-modular-application-using-prism-v2-screencast-44--decoupled-communication

                              Wednesday, August 18, 2010

                              SharePoint 2010 as Application Development Framework

                              When i started working on SharePoint , i never thought it to be more than a document management system . Even today when i mention SharePoint i know what's in the end user mind( Document , Document , Document .......) .

                              SharePoint has changed so drastically within past decade. I was always excited about the fact that it's possible to develop custom application using SharePoint 2007 as base framework . We did multiple implementation and development time has reduced around 50 % . Reason is that we dont need to spend time doing too much data modelling obviously there is downside to it as complex data centric application is not real contender for such efforts and neither transaction based application . But what i have seen as per my experience is that in any organization there are very few key applications which are complex and they are mostly business drivers other are small custom applications just to automate business process and no surprise that these small applications sometimes makes more than 50% of the applications in an organizations and are good contender to be developed using SharePoint as framework .

                              Custom applications developed on top of SharePoint 2007 comes with drawbacks too , biggest evil is performance. Too much of data will drain the server resouces and might take ages to load pages. So i would say application development in SharePoint 2007 has proven to be more of POC and learning platform.

                              SharePoint 2010 seems to much more mature with its 64 bit architecture and promises to provide deliver better performance.

                              Story cut short , non business centric applications will be developed using SharePoint in future. So if you would like to equip yourself then refer the below URL :

                              http://www.microsoft.com/downloads/details.aspx?FamilyID=64b55569-2168-4545-8b7c-f185b2cf967d&displaylang=en

                              SharePoint 2010 Resources

                              If you are looking for one stop shop for SharePoint resources than this one is good place to start with :
                              http://blogs.technet.com/b/vedant/archive/2010/06/14/sharepoint-2010-resource-guide.aspx

                              and if you are the ones who prefer videos than here is the link :

                              http://sharepoint.microsoft.com/en-us/Pages/Videos.aspx?VideoID=14

                              SharePoint 2010 Edition Comparison with Quick Details

                              http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx

                              Reference Architecture: Building a Cost Optimized, High-Throughput HL7, EDI, and FHIR Processing Pipeline on OCI ( Published in Oracle Blog)

                               OCI (Oracle Cloud Infrastructure) provides more than 200 services to build your next enterprise application. Explore the blog to learn how ...