Wednesday, May 31, 2006

Microsoft Office System Developer Conference

Microsoft announces the Microsoft Office System Developers Conference in the Netherlands and it's goint to take place in Nieuwegein (that's near Utrecht) on the 6th of june. Well I'm going to be there ofcourse, I'm really interested what they are going to show us about the Workflow foundation in use with Sharepoint and the VSTO for Office 2007. Here's the time table (in dutch)

Programma en sessies 09:30 - 10:00 uur Ontvangst 10:00 - 11:15 uur Plenaire sessie 11:15 - 11:30 uur Zaalwissel 11:30 - 12:30 uur Breakoutsessies Overzicht server-ontwikkeling Microsoft Office Excel 2007: Bouw bedrijfsinformatie-oplossingen met behulp van Excel en SQL Server 2005 Analysis Services 12:30 - 13.15 uur Pauze 13:15 - 14:15 uur Breakoutsessies Nieuwe Office XML-bestandsformaten (inleiding) Hoe werkt workflow in Windows SharePoint Services en Microsoft Office System? 14:15 - 14:30 uur Pauze 14:30 - 15:30 uur Breakoutsessies Visual Studio Tools for Office (VSTO) Technical Preview voor Office System 2007: overzicht en add-ins op applicatieniveau Microsoft Office System Server 2007 search: personaliseer de gebruikerservaring 15:30 - 16:00 uur Afsluiting
Hope to see you there ;)

Tuesday, May 30, 2006

Open in MS ... link

aposted a nice article how to implement the 'Open in MS xxxx' link for clients that don't have Office 2003 installed. However I'm now working in a Sharepoint environment with Office2k/XP users and they have no problem getting the 'open in MS word/excel link'. But i'm curious if it will also work for the non-standard Office applications like Project and Visio. I'll let you know ;)

Usefull Sharepoint SQL Queries

A collegue from mine mentioned a link that leads to some SQL queries that you cannot (easily) have with a custom build webpart (with or without using webservices).. Some examples plz! Oh yeah please note that it's not really recommended to use SQL queries on a Sharepoint databases. I think a good guideline is to use it when there are (or few) users online so a deadlock can be avoided at all times.

  • List of unhosted pages in the SharePoint solution:
    select Webs.FullUrl As SiteUrl, 
    case when [dirname] = '' 
    then '/'+[leafname] 
    else '/'+[dirname]+'/'+[leafname] 
    end as [Page Url], 
    CAST((CAST(CAST(Size as decimal(10,2))/1024 As 
       decimal(10,2))/1024) AS Decimal(10,2))   AS  'File Size in MB'
    FROM     Docs INNER JOIN Webs On Docs.WebId = Webs.Id
    where [type]=0 
    and [leafname] like ('%.aspx') 
    and [dirname] not like ('%_catalogs/%') 
    and [dirname] not like ('%/Forms') 
    and [content] is not null 
    and [dirname] not like ('%Lists/%') 
    and [setuppath] is not null 
    order by [Page Url];
  • List of top level and sub sites in the portal and the number of users:
    select  webs.FullUrl ,Webs.Title, COUNT(WebMembers.UserId) As 'Total User'
    from Webs INNER JOIN WebMembers 
    ON Webs.Id = WebMembers.WebId
    where fullurl  like '%sites%' AND fullUrl <> 'MySite' AND fullUrl <> 'personal'
    Group BY webs.FullUrl,  Webs.Title
    Order By  'Total User' desc
  •  

    In addition to a comment from this post. If you want to check the usage of your portal and it's sites you can use this code :

     

    try
    {
    //Get the sitecollection through the Administration model using SPGlobalAdmin and SPVirtualServer
    SPGlobalAdmin globalAdmin = new SPGlobalAdmin();
    System.Uri uri = new System.Uri("http://rldspst01");
    SPVirtualServer virtualServer = globalAdmin.OpenVirtualServer(uri);
    SPSiteCollection siteCollections = virtualServer.Sites;

    //For each site in the sitecollection collect all relevant information from which the content or security is changed today
    foreach (SPSite site in siteCollections)
    {
    output.Write("<table><tr>");
    output.Write("<td>" +site.RootWeb.Title.ToString() + "</td>");
    output.Write("<td>" +site.RootWeb.Url.ToString() + "</td>");
    output.Write("<td>" +site.LastContentModifiedDate + "</td>");
    output.Write("<td>" +site.LastSecurityModifiedDate + "</td>");
    //We also want to publish information about the sizing of the site
    SPSite.UsageInfo info = site.Usage;
    output.Write("<td>" +Convert.ToString(info.Storage / 1024 / 1024)+ "</td>");

    //Disposing of the objects
    site.RootWeb.Close();
    site.RootWeb.Dispose();
    site.Close();
    site.Dispose();
    }
    }
    catch(Exception error)
    {
    Console.WriteLine(error.Message.ToString());
    }

    Please be aware that you can only execute this if you have the proper Sharepoint admin rights. And you got to set the trustlevel in the web.config from WSSMinimum to FULL

    Thursday, May 25, 2006

    WSS v3 also available for download

    Well I guess not everybody has the day off today since Joris posted today that Windows Sharepoint Services v3 is also available for download from the Microsoft site. Strangely enough it's not part of the Office 2007 beta2 suite. So I'm guessing maybe that there is still a difference between MOSS and WSS? I surely hope not, the OO model and the webservices in the 2003 version were much better for WSS that it was for SPS. I guess time will telll ;) But to get the beta2 from WSSv3, click here

    Wednesday, May 24, 2006

    2007 Migration options

    After reading Joel Oleson's post about migration scenario's I was very keen to see what would happen if I attached a existing 2003 content database to the new 2007 configuration. But what amazed me was the fist question during installation of Sharepoint 2007. I could choose whether I wanted a) to gradually migrate from a existing configuration (the heavy customized and large environments) b) just migrate from the existing configuration c) to install this version next to the 2003 version Because I want to attach a existing database I choose option C btw.. the only thing that did annoy me was being prompted for what seemed like hours with the following screen : To be continued...

    SQL Intellisense

    I don't think I've ever seen this but some guys over at RedGate have developed a plugin for Microsoft SQL Servers that enables Intellisense while you're writing SQL code!

    Office 2007 is here!!!!!!

    Well.. not the final version but the beta2 of Office2007 is out! And I'm downloading while I'm writing this :) I'll keep you posted! Maybe it's a good time to read all the links about 2007 that Joris posted earlier.

    Tuesday, May 23, 2006

    I've made it to Mike Walsh's FAQ :)

    Well I made it there a couple of weeks ago but I thought it was worth mentioning. Check the following link Robin's contribution to the WSS bible It has to do with the fulltextsearch on WSS level not working at all and how to enable it again on (as Mike mentioned) nonsupported Microsoft way.. but hey.. it works ;)

    Robin Meuré had this additional suggestion Note that I would only do this in complete desperation as it messes with the WSS database If you have a catalog that won't populate you can also do the following (if in the WSS Central Administration page you get an error if you check 'enable full text search indexing'). There are two stored procedures in the WSS database called "proc_EnableFullTextSearch" and "proc_DisableFullTextSearch". First delete the catalog, secondly open SQL Query analyzer (make sure you have selected the proper WSS/Site database) and type 'exec proc_DisableFullTextSearch'. This ensures that every index that was created will be removed. After this type 'exec proc_EnableFullTextSearch' and voila, the full text search index will work again!
    Btw Mike, thnx again!

    SharePoint 2007 Beta2 SDK's Available

    Via Jan and then via Patrick ;) The release of Beta2 is almost here! The SDK's for Windows SharePoint Services (WSS) and Microsoft Office SharePoint Server (MOSS) are already available to download.

    • Windows SharePoint Services V3: Software Development Kit
      The Windows SharePoint Services V3 (Beta) SDK is a preliminary release for solution providers, independent software vendors, value-added resellers, and other developers to learn about the new Windows SharePoint Services platform. It features conceptual and "How to" articles, sample code, and preliminary programming references. The Windows SharePoint Services V3 (Beta) SDK will be updated for the released version of Windows SharePoint Services V3.
    • SharePoint Server 2007: Software Development Kit
      The Microsoft Office SharePoint Server 2007 (Beta) SDK is a preliminary release for solution providers, independent software vendors, value-added resellers, and other developers to learn about the new SharePoint Server 2007 enterprise application and platform. It features conceptual and "How to" articles, sample code, and preliminary programming references. The Microsoft Office SharePoint Server 2007 (Beta) SDK will be updated for the released version of SharePoint Server 2007.

    New challenge!

    So.. i'm faced with a new challenge and that is to get from every single wss-site and portal all the users that belong to a certain domain and put them all in an excelsheet (or more desirable is to check if a new account exists and add this to the site/portal). Sounds cool huh? ;) Update : the requirements are to create a list of all the accounts from the 'old' domain for auditing reasons. And furthermore, every day a batch of 50 users are migrated from the old domain to the new domain. And I've got to check whether one of this 50 users exists in one of the Sharepoint sites and if so, add the new account. After the moment that all the users are migrated I've got to make sure that all of the old accounts are removed from Sharepoint. I'm already playing with it and i'm just a bit confused with function to use from the Usergroup webservice. Should I use :

    • usgrp.GetUserCollectionFromSite
    • usgrp.GetUserCollectionFromWeb
    • usgrp.GetAllUserCollectionFromWeb
    I reckon that the last function will gather the same information as the following page "/_layouts/1033/siteusrs.aspx", basically giving me a list of users who ever accessed the site. And the other will provide me with the usernames who are registered as users on that site.

    Thursday, May 18, 2006

    Wanted : Sharepoint Rapid Response Engineer

    Via Daniel McPherson :

    If you love SharePoint, love to travel, love the challenge of troubleshooting hard problems, love delivering specialised workshops AND want to work in a way cool, growing team, then drop me a line for a chat.

    Sharepoint Forms

    Mart @ TamTam posted a nice post about Sharepoint forms. Basically what it does is adding Infopath functionality without Infopath :) As Mart says, this is not much of use with Sharepoint 2007 since it comes with its own Forms server. But for users who do have the current version of Sharepoint and want to use electronic forms this could be a really nice solution!

    Sharepoint Backup strategies

    There are several ways to backup your Sharepoint environment. Depending if you have a complete Portal installation or just Windows Sharepoint Services. After reading the Disaster Recovery in SharePoint Products and Technologies we came to the following conclusion for our scenario: - STSADM Backup your sites with stsadm - SPSBACKUP Backup your configuration and portal with spsbackup So no individual SQL backups are necessary (at least that's what we thought :)), since all the backups that are being made are extracts of SQL. In the document by Microsoft there are scripts to automate this whole process. The only thing we didn't do is doing a backup transaction log of each database. By not doing this, this log will grow and grow and in the worst case scenario it consumes all of the harddisk space of your database server. So the recommended solution : - STSADM Backup your sites with stsadm - SPSBACKUP Backup your configuration and portal with spsbackup - Transaction log backup Backups the transaction log

    EventLogCatcher

    In the organization I'm currently working there was a demand to check whether the Sharepoint backups were being done properly. To do this I had to face some challenges : 1. Impersonate on the fly because we have one intranet Sharepoint environment en one extranet environment. Each with a different domain, so one user account was not enough to check if the backups were complete. With some Googling I found a class which did just the trick. So kudos to NetoMatix (http://www.netomatix.com/ImpersonateUser.aspx) 2. Fortunatly to check if the backups are being done, the process SPSBackpup writes logs to the eventlog. So I need to check the eventlog.. with some googling again I found the following piece of code http://www.aspheute.com/english/20000811.asp 3. Write logs to a Sharepoint list on the intranet environment. I used the listswebservice for this part. Some examples are in the WSS SDK and I rewrote some code to make it work. This was the most tricky part I might add, because if you don't put in the proper data in a field, the whole listitem won't be uploaded (and no bloody error is given!!). 4. Show KPI icons (eg. red stoplight if backup has failed) I uploaded some icons into a document library (coud be also picture library, would make more sense to be honest) and I linked to these when I inserted a listitem. So without further or due here is the code ;) public static void GetAllLogs(string username, string password, string domain, string servername) { WindowsImpersonationContext impContext = null; try { impContext = NetworkSecurity.ImpersonateUser( domain, username, password, LogonType.LOGON32_LOGON_NEW_CREDENTIALS, LogonProvider.LOGON32_PROVIDER_DEFAULT); } catch (ApplicationException ex) { Console.WriteLine(ex.Message); } if (null != impContext) { try { EventLog aLog = new EventLog(); aLog.Log = "Application"; aLog.MachineName = servername; foreach (EventLogEntry entry in aLog.Entries) { if (entry.Source == "SharePoint Portal Server Backup") { if (entry.TimeWritten.Date == System.DateTime.Now.AddDays(-1).Date) { InsertTask(entry); } } } } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { // Finally we have to revert the impersonation. impContext.Undo(); } } } private static void InsertTask(EventLogEntry entry) { Lists.Lists listService = new Lists.Lists(); listService.Credentials = new System.Net.NetworkCredential(username, password, domain); listService.Url = "http://servername/_vti_bin/lists.asmx"; //Met deze functie gaan we XML sturen naar de webservice zodat deze gegevens in een list kan zetten XmlDocument doc = new XmlDocument(); XmlElement updates = doc.CreateElement("Batch"); int x = entry.Message.IndexOf("successfully"); int y = entry.Message.IndexOf("started"); int z = entry.Message.IndexOf("fail"); if (y > -1) { } else { StringBuilder sb = new StringBuilder(); sb.Append(""); sb.Append("New"); sb.Append(""+entry.MachineName+""); sb.Append(""+entry.TimeGenerated.ToShortDateString()+""); sb.Append(""+entry.Message.ToString()+""); // if (y > -1) // {sb.Append("http://servername/Document%20Library2/KPINORMAL1.GIF, http://servername/Document%20Library2/KPINORMAL1.GIF/KPINORMAL1.GIF");} // if (x > -1) { //sb.Append("http://servername/Document%20Library2/KPINORMAL0.GIF, http://servername/Document%20Library2/KPINORMAL1.GIF"); sb.Append("http://servername/Document%20Library2/KPINORMAL0.GIF, http://servername/Document%20Library2/KPINORMAL1.GIF"); } else if (z > -1) {sb.Append("http://servername/Document%20Library2/KPINORMAL2.GIF, http://servername/Document%20Library2/KPINORMAL2.GIF");} sb.Append(""); updates.InnerXml = sb.ToString(); Console.WriteLine("Inserting..."); XmlNode node = null; //De daadwerkelijke insert van het xmldocument in de list try { node = listService.UpdateListItems("Backups",updates); } catch (Exception err) { if (err.Message.StartsWith("The underlying connection was closed")) Console.WriteLine("The feedback service is currently unavailable. Please try again later"); else Console.WriteLine(err.Message); } } } So just call the GetAllLogs function and you're done ;)