Thursday, February 18, 2010

List of SharePoint 2010 OOB Features

Here's a (exhaustive?) list of all the OOB Features and their respective guids available in SharePoint 2010. Found via this post.

http://blogs.msdn.com/mcsnoiwb/archive/2010/01/07/features-and-their-guid-s-in-sp2010.aspx


This list might come in handy in the future.

Sunday, January 31, 2010

SharePoint 2010 Beta 2 SQL Server Version

I ran into some trouble getting SQL Server installed on the same box as SharePoint. It think it may have something to do with the order of installing applications. As a general rule of thumb make sure that you install from the oldest to the newest apps. This is especially true when working with beta software.

Running the configuration wizard I discover that  SharePoint 2010 requires the latest SQL Server updates be installed.

SharePoint2010_Wizard_SQL

SQL Server 2005:

SQL Server 2008:

Posting it here hoping it will save someone else some trouble.

Friday, January 29, 2010

SharePoint Workflow Versioning

Upgrading Workflows in an existing SharePoint site can be very tricky. Just copying in a new version is not the best practice. Depending on what changes were done to the new version of the assembly SharePoint may end up having trouble re-hydrating (deserializing) the currently in-progress workflows.

Here are some excellent articles I found recently on how to properly implement versioning, its potential pitfalls and how to overcome them:

Another alternative approach which I think is also a good solution:

Adding a new item to a SharePoint List

Using SPList.Items.Add() is not the best way to add a new item to a list. This is because the moment you access the get method on the Items collection it retrieves all the items into memory.

A quick peek at the Microsoft.SharePoint.dll assembly via reflector confirmed it:

sharepoint.SPList 

You may not notice a difference in performance in the dev environment, but once your list starts to grow it will gradually degrade.

I recently learned this the hard way. This is the best way to add a new Item:

SPList list = _Web.Lists[LIST];                    SPQuery query = new SPQuery();
query.RowLimit = 0;
SPListItem item = list.GetItems(query).Add();
item[TITLE] = “testing”;
item.Update();

On an unrelated note, executing a query with a RowLimit generates an underlying SQL query such as  SELECT TOP X ..... where X is the RowLimit value.

I wonder if the behavior is still the same in SharePoint 2010. Hmmm...

References:

More best practices on SharePoint:

Saturday, August 08, 2009

Windows 7 Upgrade Scenarios

Microsoft has published the various upgrade paths for Windows 7. Its not as complicated as I expected, but still complicated for the average user. A visual representation here.

BY the way can someone explain to me the difference between “Upgrade to Windows 7” and  “Anytime Upgrade to Windows 7”?

Friday, July 03, 2009

Adding outbound Windows Firewall rules using Powershell

This is something I wrote a while back, thought I’d post it here. It does exactly what the title says. Its basically a port of the following:
http://msdn.microsoft.com/en-us/library/aa364695(VS.85).aspx

Saturday, June 06, 2009

Media Coder Samsung P2 presets

I’ve been using Media Coder to encode videos into my P2 for a while now and its been a great alternative to what comes out of the box.

Well, all *was* great until I lost the presets for the P2! It took me an whole afternoon to reconfigure the settings that work with the P2. I’m posting the preset file here in the interest of saving someone else some time.

These setting work great for me. Your mileage may vary.

Creating “App Paths” using Powershell

I’m a big fan of Slickrun and its a tool I recommend everyone should have in their toolbox.

Unfortunately, working onsite on the client’s computers, installing third-party software is usually frowned upon. So I’ve got to make due by using the app paths.

The App Path technique of launching applications have have been around for a while. Read More:

http://www.tweakxp.com/article36950.aspx

The purpose of the script is to make the whole registry editing process a bit easier.

You can download the script here:

And execute it as such:

appPath.ps1 -key "notepad2.exe" "c:\windows\notepad2.exe"
or
appPath.ps1 -key "notepad2.exe" -path "c:\windows\notepad2.exe"

Where –key is the entry you would type in the Run dialog (please note that the extension is required).  And –Path being the actual path of the file.

Disclaimer: This script modifies the registry. Use at your own risk, I will not responsible for anything that breaks as a result.

Friday, June 05, 2009

Troubleshooting Orphaned Users in SQL Server 2005 / 2008

A couple of days ago, I was tasked with moving a database from an older server to a new souped-up box. Unfortunately the transition was not as smooth as I had hoped for. After restoring the db into the new server I started running into trouble with orphaned users.

An orphaned user is basically just that, a database user without a corresponding server login.  This usually happens when trying to restore a database into a new server, like what I was doing or accidently deleting the server login.

Luckily this issue can be solved relatively easy using the sp_change_users_login stored procedure.

First I get a list of orphaned users and their SIDs using the following procedure:

sp_change_users_login @Action='Report';

Next, I create the missing login from scratch (e.g. “NewLoginName”). The server mappings are not required as the database user roles are preserved in the database.

Then execute the stored procedure again with the following parameters:

sp_change_users_login
      @Action='Update_One',
      @UserNamePattern='dbUserName',
      @LoginName='NewLoginName';

This re-jigs the broken “dbUserName” user with the newly created Server Login “NewLoginName”.

Its worth mentioning that even though there might be a login name existing on the new server identical to the database user name, they are not the same until linked together. You can find out for sure using the above stored procedure with the “REPORT” parameter.

Finally, hereare some instances where sp_change_users_login cannot be used:

  • Cannot be used to map database users to Windows-level principals, certificates, or asymmetric keys.
  • Cannot be used with a SQL Server login created from a Windows principal or with a user created by using CREATE USER WITHOUT LOGIN.

More information:

Tuesday, March 03, 2009

Microsoft End of Support Lifecycle Dates

Posting this here hoping that it may save me a few minutes of googling in the future.

Pretty Much all Microsoft Product
s
http://support.microsoft.com/gp/lifeselectindex

Servers - Service Packs
http://support.microsoft.com/gp/LifeSupSps#Servers

Non-Server Windows
http://www.microsoft.com/windows/lifecycle/default.mspx

Friday, December 12, 2008

Download YouTube videos using Powershell

Now that I'm back home in Sri Lanka, I'm getting re-accustomed to the slow Internet speeds over here. Slow internet speeds was the reason for me to write the YouTube downloader back in April.

So I spent a lazy afternoon today trying to port that code into Powershell. And here's the result:

How it works

The script first figures out the direct download link and then hands it off to a download manager which performs the actual download. You should be able to plug-in any download manager that supports command line arguments but I prefer to use wget for its simplicity.

Information on how the direct link is extracted can be found in my original post.

Use $downloaderPath and $downloaderArguments to configure the path of wget and its arguments respectively. The script also supports traversal through proxies and can be configured using the $proxy and $proxyPort variables.

The script accepts one parameter; the watch url of the video.

.\psVDownloader.ps1 http://www.youtube.com/watch?v=N_c60Sp7Gtc

.

Please be aware that this script is purely for research purposes only. And I believe that you will be violating the YouTube TOS by trying to use its streams in ways other than intended.

Tuesday, December 09, 2008

SSRS - Unable to load client print control

One of the customer sites I work at was suddenly unable to print SSRS reports any more. This issue was occurring for only a few of their client boxes, so this rules out the possibility that it might have been a server issue.

It turns out that SSRS uses an activex control to provide some enhanced printing options. Here's some more information on it (taken from the MSDN site):

The Microsoft ActiveX control, RSPrintClient, provides client-side printing for reports viewed in a browser. The control displays a custom print dialog box that supports features common to other print dialog boxes, including print preview, page selections for specifying specific pages and ranges, page margins, and orientation.

After some investigating it looks like a conflict with KB956391. More information on it here:

http://support.microsoft.com/kb/956391

I'm guessing that this hot fix may have been pushed out by windows update, which explains it's sudden manifestation.

This is the proper way of fixing the issue; as explained in Brian Hartman's blog:

http://blogs.msdn.com/brianhartman/archive/2008/11/05/client-print-fails-to-load-after-microsoft-update-956391.aspx

Or alternatively just uninstall KB956391.

More useful discussions on the "Unable to load client print control" issue:

http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=332145&SiteID=1

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=4006280&SiteID=17

http://wills-blog.com/?p=220

http://forums.microsoft.com/msdn/showpost.aspx?postid=4006172&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=4

Sunday, October 12, 2008

Abstracting underlying data sources for SSIS packages using Views

In a perfect world, we'd never have changes to the schema once it has been defined. But in practice this is almost never the case.

I stumbled upon this excellent article which provides a solution to minimize the effects of change.

http://bi-polar23.blogspot.com/2008/09/views-as-for-ssis.html

Retrieving SQL Server 2005 Product Version

Here’s the query used to retrieve the SQL Server Production Version information.

Pretty useful when diagnosing problems in multiple environments.

SELECT  SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

Storm, replacement for the aging WebServiceStudio

I am frequently required to work with 3rd party Web Services. These web services are often underdevelopment as well and more often than not tend to break our applications after each update.

I’ve been using WebServiceStudio for a while now to diagnose problems that arise after each update. WebServiceStudio was available on GotDotNet until it got shutdown and haven’t seen much updates since.

Luckily there’s a new open source tool that I discovered that replaces this aging application; Storm.

Here’s a description taken from the project site:

STORM is a free and open source tool for testing web services.

It is written mostly in F#. (I love this language!)

STORM allows you to

  1. Test web services written using any technology (.NET , Java, etc.)
  2. Dynamically invoke web service methods even those that have input parameters of complex data types
  3. Save development time and money. Creating throw-away test client apps just to test the web service is just too wasteful
  4. Test multiple web services from within one UI.
  5. Edit/Manipulate the raw soap requests.
  6. Others (Try out the tool and find out yourself!)

 http://www.codeplex.com/storm

Friday, September 05, 2008

Unable to restore Virtual PC Console

Well, I've had this happen to me more than a few occasions now. This is where the console appears to remain minimized. Doesn't seem to affect functionality but can get really annoying. I'm not sure what exactly causes it but I'm going to post the fix here so I don't have to look for it every time happens.

Virutal PC has an aptly named file called options.xml to maintain settings related to the console. Its located here:

C:\Documents and Settings\{windows account name}\Application
Data\Microsoft\Virtual PC\Options.xml

(Replace {windows account name} with your windows account name)

What we're interested is in this set of tags:

<window>
    <console>
        {...snip...}
        <left_position type="integer">0</left_position>
        <top_position type="integer">0</top_position>
        {...snip...}
    </console>
        {...snip...}
</window>

You should have some obscene values for the above keys. Just reset them to 0, restart Virtual PC and you're good to go.

Tuesday, August 05, 2008

Using Powershell to Query and Integrate MP3 Album Art

I've been trying to update my mp3 collection with album art since I got the P2. There are many tools out there that allow you to achieve this, but none that provide an easy and flexible way to automate the whole tagging process. That's why I wrote a quick and dirty Powershell script to do the job for me. Plus, it gives me a chance to play around with Powershell.

How it works:
The script can be executed in the following manner:
.\Mp3AlbumArt.ps1 .\mp3\*def*.mp3
or
.\Mp3AlbumArt.ps1 .\mp3\*\*.mp3
(recurse through sub folders)

The only parameter takes in the paths of the files that need to be processed. The script uses Greg Keogh's excellent NTag library for integrating the album art into the ID3 Tag. The album art itself is retrieved by querying the Amazon Web Service using the Artist and Album Tags. Obviously it doesn't work very well if the Meta tags are not set up properly.

Some assembly required:
You would need to register for an Amazon Web Service Account to get an key to query the service. Replace your key in the commented area to get stared.

Future:
I was in a rush to get something working so didn't spend too much time error handling or on any best practices. As I gain more experience with powershell, I will eventually re-write this script to take advantage of powershell functionality. But for now it serves is purpose.

References:

Download:

Comments and constructive criticism appreciated.

Sunday, August 03, 2008

The Microsoft Habu - 2000 dpi of gaming goodness

As most of you would know, I like to waste most of my free time gaming online. So it wouldn't come as a surprise that I've been hunting for the perfect business/gaming mouse for a while now. I was pretty excited when I finally got my hands on one of these babies. And what makes it sweeter is that I got it at real good price as well.

Like every other input device, its still taking me some time to get used to it. Its not an overly complicated mouse as far as gaming mice are concerned(this is a good thing). It feels solid and fills your hand pretty good (I still don't understand how and why some people use micro laptop mice). The on-the-fly dpi changer might come in handy. Haven't played any games with it yet, since I'm away from my main gaming rig at the moment, but I'm sure it would bump up my frags by a few kills at least :).

Get the Full Reviews and Specifications:

Debugging XSLT using Visual Studio 2005 / 2008

Visual Studio has the ability to debug XSL stylesheets. This a extremely useful feature that a few seem to know exist and use regularly.

Most of the projects I'm involved with use XSLT in one way or another. And the VS debugger along with other tools have saved me countless hours of frustration.

Here's a quick guide to get you started:

  1. Create / Open up the XSL file using Visual Studio
  2. Setup break points as necessary
    breakpoints
  3. Make sure that the XML Editor toolbar is visible
    XML Toolbar
  4. Click on the Debug XSLT button to start debugging
    debug_xsl
  5. A warning message would appear asking you to setup an input file. This would be the XML file that needs to be transformed. Click YES and select the input file.
    filename
  6. Step through the code.
    stepthrough

The only disadvantage or limitation rather is that you can't specify values for xsl:param variables. The workaround I use is to re-define the parameter as an xsl:variable , set the expected input value.

xsl_variable

On a related note, XslCompiledTransform class supports stepping into the stylesheet while debugging. The only pre-requisite is that the class should be instantiated with the debug parameter value set to true . Detailed instructions provided here.

Friday, August 01, 2008

New Site Column as a Managed Property

I was trying to create a Managed property from a newly created site column. What I didn't realize was that the column has to have content and crawled at least once (incremental/full, it doesn't matter) for it to be available in the "Crawled property Selection". It does makes sense if you think about it. So yeah.

More detailed information here.

Remember Kids, Google! is your friend.