Capturing the Current User’s Manager in MOSS Using SPServices and GetUserProfileByName

I had a question today about how to get the current user’s manager and put the value into a Person or Group column in a list. This one only works in MOSS or SharePoint Server 2010 (not WSS 3.0 or SharePoint Foundation) because the UserProfileService Web Service is only available there.

The code is relatively straightforward: a call to SPServices to get the results from  GetUserProfileByName and then a little more code to poke it into the appropriate Person or Group column. In this case, the Person or Group column is called ‘Manager’.

$(document).ready(function() {

  var managerName;
    operation: "GetUserProfileByName",
    async: false,
    AccountName: $().SPServices.SPGetCurrentUser(),
    completefunc: function (xData, Status) {
      $(xData.responseXML).find("PropertyData > Name:contains('Manager')").each(function() {
        managerName = $(this).parent().find("Values").text();

  // There's no easy way to find one of these columns; we'll look for the comment with the columnName
  var searchText = RegExp("FieldName=\"Manager\"", "gi");
  // Loop through all of the ms-formbody table cells
  $("").each(function() {
    // Check for the right comment
    if(searchText.test($(this).html())) {
      $(this).find("div[Title='People Picker']").html(managerName);
      return false;
}); // End $(document).ready

In line 8, you can change the value Manager to anything else you’d like to get back from the GetUserProfileByName operation, and in line 14, you could change the Fieldname to whatever your column name for the Manager might be.

The available values from GetUserProfileByName in my test MOSS environment are:

  • UserProfile_GUID
  • AccountName
  • FirstName
  • LastName
  • PreferredName
  • WorkPhone
  • Office
  • Department
  • Title
  • Manager
  • AboutMe
  • PersonalSpace
  • PictureURL
  • UserName
  • QuickLinks
  • WebSite
  • PublicSiteRedirect
  • SPS-Dotted-line
  • SPS-Peers
  • SPS-Responsibility
  • SPS-Skills
  • SPS-PastProjects
  • SPS-Interests
  • SPS-School
  • SPS-SipAddress
  • SPS-Birthday
  • SPS-MySiteUpgrade
  • SPS-DontSuggestList
  • SPS-ProxyAddresses
  • SPS-HireDate
  • SPS-LastColleagueAdded
  • SPS-OWAUrl
  • SPS-ResourceAccountName
  • SPS-MasterAccountName
  • Assistant
  • WorkEmail
  • CellPhone
  • Fax
  • HomePhone

The Magic of Hosted WSS

Whoa, I’m really falling down on my blogging lately.  It’s not that I don’t have as much to say, it’s that Twitter and other things end up taking more of my time these days. ("Microblogging" is the word we use to make tweets legitimate.)

So here’s something. I think I may have outlined this a bit before, but I thought it might interest someone out there to know how much I manage to wring out of my $29/month of hosted WSS.  My friends over at keep me up and running and manage to make me feel like a Very Important Customer, even though Sympraxis Consulting is just a one man shop at the moment (that would be me).

WSS is generally pooh-poohed by the SharePoint aficionados out there as too low end to be useful.  (Of course, Microsoft would also love it if everyone purchased licenses for MOSS.) However, I’m using my WSS site for a number of things, and I think that this is pretty impressive given that it’s free software:

  • As my Internet-facing site ( — This is fairly vanilla, though I do have a custom master page with custom CSS and a little jQuery just to give it some sizzle.
  • As my Intranet (permission-protected)– While I have a custom master page and CSS applied here, the branding serves little purpose other than to give me a visual cue where I am.
  • As my Extranet (permission-protected) – When I’m working with clients, I set up a site for each where we can share documents, etc.  These are plain vanilla Team Sites or even Blank Sites to start. To date, these sites have gotten very little use.  (It’s always surprising how little people who hire you to build SharePoint stuff for them actually want to use SharePoint to collaborate on the process!)
  • As a demo site for some of the stuff I build ( – This is a vanilla Blank Site with some customized pages with JavaScript, jQuery, etc., which I use as a place to demo some of the jQuery Library for SharePoint Web Services functionality and some other stuff.
  • As my development platform for my jQuery Library for SharePoint Web Services (permission-protected) — This is where I’m doing my "work".

All this without ever touching the servers!

Office 2007 / WSS / MOSS SP2 Is Available

I’m unlikely to unearth better details on this than good ‘ole SharePoint Joel. Check out Joel’s post for all the dirt. If, though, you’re like me and you just say “Gimme the downloads!” here are the key bits:

2007 Microsoft Office servers Service Pack 2 (x86)
2007 Microsoft Office servers Service Pack 2 (x64)

2007 Microsoft Office Suite Service Pack 2

Measure Twice, Cut Once – Even With SharePoint

I exchanged a bunch of emails last week with someone named Chris who had found my blog and was just starting out with WSS.  His goal was to do a proof of concept of sorts, based on some work he had read about which was done by Provoke (a Microsoft Gold Certified partner based in New Zealand).  It’s well summarized in the article over at the Microsoft SharePoint Team Blog entitled How We Did It – Tag Driven Information Architecture using MOSS 2007 for the New Zealand Ministry of Transport.  Chris wanted to use this proof of concept to justify the expense of SharePoint (MOSS) for his company.  (Microsoft take note: another hot lead, Denver area.)

Chris is clearly very smart and an accomplished .NET developer.  And there’s the rub.  As a developer, the first thing it seemed he wanted to do was write code.  Since it was just a set of emails, I’m not fully clued in on what the process was to get to the point where they were, of course.  And, in no way am I picking on Chris – he knows what he is doing.  But the exchange reminded me that my view on using Sharepoint as a platform for the enterprise is more of a measure twice, cut once one.  By this I mean several things:

  • The big picture is more important than the smaller technical details.  A great high-level architecture and plan will beat a smaller coding win in the long run.  Be sure you understand how you want to use the SharePoint platform in a holistic way before you get too caught up in the details of the implementation.  (As a developer, I sometimes have to remind myself of this, too!)
  • In many cases, you just don’t need to write managed code to meet your requirements.  As anyone who follows this blog knows, I’m a big fan of what I call the "Middle Tier", by which I mean developing with SharePoint Designer.  Packaged managed code gives you portability and deployment capabilities that are critical for some situations, but don’t discount the middle tier for fast prototype development and real solutions.
  • Look at the inherent capabilities of SharePoint thoroughly before you decide to go beyond them.  I always say that SharePoint gives you 80% of everything it offers, but it’s the important 80%.  Don’t just decide that you have to suck it up and live with what’s there, but realize that what *is* there can take you very far.  Often that whiz-bang approach you think will be the right answer up front won’t be what you end up wanting in the long run.  Think about doing your first phase implementation using more of the out of the box capabilities, and then continually reassess.  This is not a technology where you should ever be done – it’s an evolutionary process.

For those of you in Massachusetts, Happy Patriot’s Day!

Microsoft SharePoint “14” is now Microsoft SharePoint 2010

The official press release came out today and Tom Rizzo followed up on the Microsoft SharePoint Team Blog.  The name itself doesn’t probably mean too much (except that the MOSS acronym will no longer work – MSP2kX anyone?).  The other important piece of information in the release is the general release timeline:

  • Exchange 2010 will be the first product in this lineup, entering beta for customers to download today. Exchange 2010 will become available in the second half of 2009.
  • Office 2010 — including Office Web applications, SharePoint Server 2010, Visio 2010 and Project 2010 — will enter a technical preview in the third quarter of 2009 and will release to manufacturing in the first half of 2010.