Sunday, August 24, 2008

Communicator Presence Controls in WPF

Last night I was preparing some ideas for a demo application I need later this week. The demo app had to look good and should be fun and interesting in the making. So I decided to code the UI in Windows Presentation Foundation (WPF). Code in XAML for WPF is simple and one will soon get the hang of it. So I went using some ListViews filled with data via LINQ to SQL and a data class. When I came to implementing Office Communicator 2007 functionality I realized that the “Microsoft Office Communicator 2007 Presence Controls” did only exists as Windows Forms User Controls and not as WPF user controls. Facing the choice of coding my own controls or try to make use of the existing Win Form controls I browsed around and found a XAML tag which enables you to host a windows forms control on a WPF page and the great part about it is really easy to use:

  1. Download the above mentioned controls from Microsoft and install them.
  2. Include the managed controls into you WPF project solution.
  3. Add the WindowsFromHost tag to the WPF XAML page.
  4. Add the necessary XML name spaces. Look for xmlns:q1 and xmlns:q2 in the example below
  5. Add the xml tag for persona list control - "q1:Personalist"
<Window x:Class="WPFHostingPresenceControls.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:q1="clr-namespace:Microsoft.Samples.Office.UnifiedCommunications.PresenceControls;assembly=PresenceControls"
xmlns:q2="clr-namespace:Microsoft.Samples.Office.UnifiedCommunications.PresenceBase;assembly=PresenceControls"
Title="Window1" Height="300" Width="300">
<Grid>
<WindowsFormsHost Name="windowsFormsHost1">
<q1:PersonaList x:Name="plMyPersonaList"/>
</WindowsFormsHost>
</Grid>
</Window>




Here after you can populate the list via code:




public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
plMyPersonaList.AddRange("pli@inceptio.dk", "someone@inceptio.dk");
}
}




and when you compile you should have something like this.



WPFHostingPrecenseControls

Friday, August 22, 2008

Exchange and Virtualization

So, can I run Exchange on a virtualization product? Yes, probably, but is it supported? You can read that in  Microsoft Support Policies and Recommendations for Exchange Servers in Hardware Virtualization Environments. The support is rather limited or should I say restricted -

  • Only validated hypervisors - that makes sense
  • Only Exchange 2007 SP1 on Windows Server 2008 - why not WS03?
  • No UM role
  • "No other server-based applications, other than management software (for example, antivirus software, backup software, virtual machine management software, etc.) can be deployed on the physical root machine. The root machine should be dedicated to running guest virtual machines."  - this is a tough requirement to meet, don't you think?
  • No dynamically expanded disks - why not (besides the performance hit)?
  • No clustering if the virtualization has comparable failover - makes sense, could be rather complicated. The recommendation is to do the high-availability using Exchange technologies.
  • No snapshots - wasn't this one of the big benefits of virtualization
  • A small restriction on the virtual CPUs - no big deal IMHO

In any case, read it for yourself and go back to the MS article whenever your want to read it again, so you pick up the latest changes.

Friday, August 15, 2008

PowerShell Support in SQL 2008

Was browsing the new features of SQL 2008. There are quite a lot and some interesting ones as well. One is the support of PowerShell. There are both a PS provider ("The provider lets you navigate the hierarchy of SQL Server objects using a path similar to a file system path. Each object is associated with a class from the SQL Server Management object models. You can use the methods and properties of the class to perform work on the objects. For example, if you cd to a databases object in a path, you can use the methods and properties of the Microsoft.SqlServer.Managment.SMO.Database class to manage the database.") and the ability to execute PowerShell commands from within the management application ("The SQL Server 2008 version of SQL Server Management Studio supports starting PowerShell sessions from the Object Explorer tree. The SQL Server 2008 version of SQL Server Agent supports PowerShell job steps"). Read it all here.