Skip to main content

Posts

Showing posts from 2010

Powershell Power

Recently we discovered an issue where the Site Deleting event receiver was being triggered when we migrated teamsites from one content DB to another. This was something we never anticipated since we were just moving sites and not deleting them. We figured out that the event receiver was being triggered since the custom teamsite data was being deleted from the source content DB. So we decided to come up with a powershell script to restore the list and DB table.In my opinion Powershell scripting just rocks. I just want to share some snippets from the code that updates a SharePoint list and DB. $web = $site.RootWeb $web.AllowUnsafeUpdates = $TRUE $teamsitemasterlist = $web.GetList($TeamsiteListName) $newlistitem = $teamsitemasterlist.Items.Add() $newlistitem["Title"] = $teamsiteTitle $newlistitem["Description"] = $teamsiteDescription $newlistitem["Provisioning Status"] = "Provisioned" $newlistitem.Update() $sqlconnection = new-object Sys...

SharePoint Blog Posts

Today we just resolved a pending issue. Our custom WP which aggregates the latest posts from all the blog sites in our site collection threw up a SQL Error " All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists ". We were unable to replicate the issue in our test servers. Even the OOTB CQWP could not surface the blog posts. Pretty strange uh.The fix was pretty simple. We had two blog sites Site A and Site B. Both the sites had only the default site columns provisioned. When you try to edit the settings for any column of type "Person or Group" in any SharePoint List, you see an additional dropdown list "Show field". The columns in both the sites need to have the same value in "Show field" when you are querying items from two different lists (SPSiteDataQuery or CrossListInfoQuery)  For example, a column called "Created By" exists for all the Blog posts in Site...

Welcome 2010

2010 has just started but is already turning out to be eventful. Jan 1st welcomed us with the Antivirus live spyware attacking my personal laptop. Spybot finally helped me clear the mess. The Stock Market does not seem to be fair with me as all my stocks just hit rock bottom. My kid has started walking like she has never before (actually she is 13 months old and just started walking a few days back). Dad and Mom have just flown to the Thailand with their army of friends. Phuket according to them is like some place in heaven :) . Authors and Producers are fighting over who should be given the credit for a movie based on a novel. I dont think this has ever happened in any movie adapted from a novel. People in the same state have different opinions on the formation of another state. Politicians surreptiously playing a game of supremacy. Medals being snatched from cops :) India losing their first one dayer after having an extremely dominant year Cleveland Cavs ending their 7 game winning s...