The SharePoint Coffee House
I'd like some SharePoint with my coffee please...

2010 Helpful Tip - SPListCollection.TryGetList Method

Friday, 2 July 2010 14:13 by Michael Mukalian

Remember when (days long ago...) you tried to instantiate to a list in SharePoint via either SPWeb.Lists["List Name"] or SPWeb.GetList("list URL"), you'd not know if the list was truly there until your code went along it's merry way, or it exceptioned out?  Well here comes SPListCollection.TryGetList().  Passing in the title of the list will either return the SPList itself or null.  At this point you can then do a null check and address it accordingly, instead of relying on an exception.

Something a little cool I just came across... - M

SPListCollection.TryGetList Method

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   2010 | Development
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Windows 7, Virtual PC and SharePoint Development

Monday, 17 August 2009 08:44 by Michael Mukalian

Took the plunge this past weekend and wiped my Dell XPS M1530 and installed Windows 7 Ultimate as well as Virtual PC.  After that, configured VPC to point to my external HD and voila!  SharePoint development environment.  No funky steps had to be done.  The same challenges are still there (32-bit guest OSes only), but all was working as of last night.

Screenshots after the break...

-M

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Development
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

SharePoint Designer 2007 Now Free!

Tuesday, 7 April 2009 11:37 by Michael Mukalian

Just caught this today...check it out!

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=baa3ad86-bfc1-4bd4-9812-d9e710d44f42&goback=.hom

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Impersonation Instead of RunWithElevatedPrivileges

Monday, 9 February 2009 13:50 by Michael Mukalian

In my Googling (we all Google to find stuff that we can use, instead of creating from scratch, right?) to find some help with an issue I was having when trying to loop through the UserProfileManager, I came across a really awesome post of Victor Vogelpel's blog that cites some code that Julien Lepine wrote to do some impersonation of the Web Application's ID.  What this code does is basically create an Identity class that runs in the context of the Web Application's ID.  Now, how does this differ with SPSecurity.RunWithElevatedPrivileges?  Well, RunWithElevatedPrivileges is kinda like a "black box" implementation in the context of the built-in "SharePoint\System" identity.  If you utilize the Identity class described above, and you give your Web Application ID the relevant access (in this case, the Manage User Profiles permission in the SSP), you're able to directly know who's doing what, where.  Better than just relying on a "black box" kinda implementation, no?

Check out the code from Victor's article.  It's a little old, but still very relevant.  Cool stuff.

Of special note: On the virtual I was working on at the time I couldn't get anything to work for the above example.  Turns out the issue was related to a fix that was applied when installing the December CU.  Remember to keep your virtual/development environments updated.

- M

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

How to Create a Cloneable SharePoint Development Environment

Friday, 2 January 2009 11:31 by Michael Mukalian

Well, I hope all had a great holiday, and welcome to the first serving of the Coffee House for 2009.

After having a number of SharePoint projects under my belt I decided to look into creating a cloneable development environment for myself.  The following is based on information and scripts from Ben Curry's blog entry on SharePoint Installation Scripts and Paul Horsfall's blog entry on SharePoint, Sysprep and SQL.  Both entries were invaluable in helping me create the process (and my scripts) below.

First off, below find the software used to accomplish this:

  1. Microsoft Virtual Server 2005 R2 (installed on your local machine)
  2. Microsoft Windows Server 2003 SP2
  3. Microsoft SQL Server 2005 SP2
  4. Microsoft SharePoint Server 2007
  5. Microsoft Visual Studio 2008

Now, let's create the necessary image:

  1. Create a new Virtual Machine, name it something sensical (in this case I called it MOSSDEV)
  2. During image creation, point to the Windows 2003 Server files and install the OS
  3. Name the machine the same as the image name (again, in this case, MOSSDEV)
  4. Upon completion give the machine the Application Server role, setting up IIS and ASP.NET
  5. Run Windows Update
  6. Install .NET Frameworks 2.x and 3.x
  7. Run Windows Update
  8. Create the necessary local machine IDs if you wish to run the various SharePoint services under them and not all under 'Administrator' (I do this out of habit instead of using the admin ID)
  9. Install SQL Server in its default installation (Install SP2 afterwards)
  10. Run Windows Update
  11. Install SharePoint Server 2007 but do not run the Configuration Wizard (Remember Advanced/Complete)
  12. Install Visual Studio 2008
  13. Install the SharePoint development assets (Extensions, WSS and Office SDKs)
  14. Run Windows Update 
  15. Install Sysprep for Win2K3 SP2
  16. Shut down the virtual machine, then copy/backup the VM's files (This is necessary as you can then spin this back up to do patches and the like, then back it up)


At this point you should now have a working MOSS machine/image that's ready for Sysprep.  Sysprep requires an .INF file to run and I've attached the one I use to create my images.  Note that you'll need to open it up and enter your correct Product Key for use.  Also note the ComputerName entry and how it's valued with an asterisk (*).  This tells the system to wait for user input before it can continue.  What this allows you to do is give the machine a name during creation.  Both of these attributes are in the [UserData] section of the Sysprep.inf file.

Sysprep also allows you to run scripts after the spinning up of the machine.  In this instance I run 2 scripts: one to set up the SQL Server correctly (startsql.bat) and one to configure MOSS (mossconfig.bat).

startsql.bat does two things: it renames the SQL Server instance from the original (MOSSDEV) to the name that you gave the machine during spin up, and then it gives the relevant DB related rights to the ID to be used for MOSS configuration (note I use a different ID for this than 'Administrator', see Step 8 above).  You'll need to change the ID in this file if you use a different one.

mossconfig.bat basically does what it says: it configures MOSS.  It creates the Farm database, sets up the necessary services, creates 3 Web Applications (SSP Web Admin, My Sites and a Portal), creates the Shared Services Provider and configures it with those Web Applications, and then creates a Site Collection on the Portal Web Application.

To Sysprep the machine:

  1. Start the image back up, logging on as Administrator
  2. Make sure your Sysprep.inf contains the correct and relevant information (Product Key, scripts to run, scripts in their correct location, etc)
  3. Run Sysprep (the system will shut down when complete)
  4. The resultant .VHD is now ready for use as a base image for creating differencing disks in Virtual Server.  Make sure you set the properties of the .VHD to Read Only before you use this.


This newly created .VHD is what will be used as the parent when creating new Differencing .VHDs.  The advantage here is that you can now create as many Differencing .VHDs as you want, all using the parent we created, and upon spinning it up you'll have a new MOSS environment to work in.  Note: when you spin up your development image for the first time, and it asks you for your machine name, it'll finish up its configuration of the machine, and then restart.  When it asks you to log on, you must log on with the ID you set up to be the MOSS setup ID (in my files I use the ID 'adminmoss' for this).  This is important as this ID will then be used to configure MOSS.

Now, when you want to create a new MOSS development environment, you create a new Differencing .VHD, use the above as the parent, and then create a new Virtual Machine using that new Differencing .VHD.  Quick and easy from that point on.

Attached in this post is a .ZIP file (CloneableAssets.zip) containing the 3 files above.

Thanks! - M

CloneableAssets.zip (2.29 kb)

Currently rated 4.0 by 4 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Present(ed)ing at the Philly.NET Code Camp on October 11th!

Friday, 26 December 2008 16:26 by Michael Mukalian

As the munged title kinda states, this posting relates to an event that has already happened. So much fer real-time, eh?

I was able to present a more "code heavy" presentation of my talk on Features and Solutions at the
Philly.NET Code Camp on Saturday, October 11th. I gotta say, what a cool event. Hundreds of folks showed up, early on a Saturday, and stayed til the evening, listening to tracks from 51 speakers that ranged all across the .NET space. It was one of the coolest things I ever did, meeting with peers, speaking on topics we all are interested in.

I'm tidying up the source code that I used for my talk and will upload in the very near future.

Oh and to any and all that showed up for my talk...thanks! - M

*** UPDATE ***
As promised, here's the code and presentation slides...
CodeCamp20081011.zip (842.53 kb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Presenting at the Philly Office Geeks User Group Meeting on September 9th!

Friday, 26 December 2008 16:19 by Michael Mukalian

As luck would have it I'm giving a small presentation on Microsoft's SharePoint Features and Solutions Framework to the Philly Office Geeks User Group during their monthly meeting on the evening of September 9th. When complete I'll see if I can post the contents of the slide deck here as well as on the Group's site.

** UPDATE **
With the site move I'm now able to have the presentation available here...
SolFeat.ppt (1.16 mb)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SharePoint Development on Vista!

Friday, 26 December 2008 16:09 by Michael Mukalian
Check this out...I found this while wandering around the Bamboo Solutions site...

For those that are looking to do some development w/o virtuals, with the information found at the following blog entry you can now set up your Vista box for SharePoint development. Cool stuff!

How to install Windows SharePoint Services 3.0 SP1 on Vista x64/x86

- M

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Bamboo | Development | Vista
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Bamboo Chart Plus Bug: Dates as Y-Axis Don't Show

Friday, 26 December 2008 16:06 by Michael Mukalian
I found this while doing some diligence around the possibility of using this part as a way to display some project (think MS Project) information based on tasks and their dates. In my work I was looking to display a Task's information and it's Due Date and Actual Finish Date as a bar chart, to show the differences of planned vs. actual.

It seems that when you set up the Chart Plus part to have its Y-Axis be Long/Short Date based, the scale shows information in the form of 12/30/1899 for each place on the scale, and not the dates in the source data.

This was duplicated by the Bamboo support team. Incidentally, kudos to them for responding so quickly (2 days) for an issue that came up for an individual (me) using a trial version of their software. Excellent in my book.

- M

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5