Archive for January, 2010

When naming the properties of a class in a management pack you should stay away from dots (“.”) in the property id. Some times you might feel tempted to include a dot after a prefix (maybe the company name or something) in the id property as you might do for the id of a custom management pack. Including a dot in the id of a property will mess upp the binding path of your forms which will result in your forms not storing the modified values in the instances.

Thanks for verifying Anders!

<Property ID=MyDate Type=datetime” />
<Property ID=“Prefix_MyDate Type=datetime” />

Not OK!!!
<Property ID=Prefix.MyDate Type=datetime” />

Comments (0)

My collegue Anders and I is playing with Service Manager in the sandbox today. We just notice a nice feature when creating views. You can create them based on related dates. For example if you want to show all items modified the last week you could configure the view according to the picture below. 

Dynamic date based views

Comments (0)

When upgrading ConfigMgr 2007 clients to SP2 there could be a problem upgrading the clients using one program. This because if you use the ccmsetup switch SMSSITECODE=AUTO users travelling between different locations can be accidentally reassigned to the primary site at the location where the client was located during the actual upgrade, that could cause advertisements to run again on the client. Why using one program you think, well using one program will ease you administration effort doing the upgrade because you can use one collection for all clients. Finally to the solution, I made a script that queries the client’s assigned site code and then uses this for the ccmsetup parameter SMSSITECODE, if there are no assigned site code AUTO is used. Put this script in the source folder of your ConfigMgr 2007 SP2 client and run the script as the installation command. Please remember that the script is delivered AS IS without any warranties.

Option Explicit
On Error Resume Next
Dim cmclient,WshShell,wshFSO,strSiteCode,strExitCode,strCmdLine
Set cmclient = CreateObject("Microsoft.SMS.Client")
Set WshShell = CreateObject("WScript.Shell")
Set wshFSO = CreateObject("Scripting.FileSystemObject")
strSiteCode  = cmclient.GetAssignedSite
If strSiteCode <> "" then
	strCmdLine = SourceDir & "\Ccmsetup.exe /noservice SMSSITECODE=" & strSiteCode
	strExitCode = WshShell.Run(strCmdLine, 0, True)
	WshShell.LogEvent 0, "ConfigMgr 2007 SP2 client upgrade executed command: """ & strCmdLine & """" & CHR(10) & "Exitcode: " & CSTR(strExitCode)
	strCmdLine = SourceDir & "\Ccmsetup.exe /noservice SMSSITECODE=AUTO"
	strExitCode = WshShell.Run(strCmdLine, 0, True)
	WshShell.LogEvent 0, "ConfigMgr 2007 SP2 client upgrade executed command: """ & strCmdLine & """" & CHR(10) & "Exitcode: " & CSTR(strExitCode)
End if
Function SourceDir
	SourceDir = Left(WScript.ScriptFullName,Len(WScript.ScriptFullName) - Len(WScript.ScriptName) -1)
End Function
Comments (2)

When customizing Service Manager you might want to create a custom form for a custom class. You’ll probably end up with some code behind for some fancy stuff interacting with the form. Maybe you want to list data from a remote data source? When dealing with scenarios like this it’s always nice to be able to debug your code. Here are the steps you need to go through to be able to debug a custom form or a custom console task (a task in the ”Task pane”) from within Visual Studio.

  1. In the code behind, add suitable breakpoints.
  2. Make sure that you’ve configured the build procedure to use “Debug” mode by opening the “Configuration Manager…” and choosing the “Debug” option in the “Configuration” drop down.*

    *If you don’t see the “Configuration Manager…” menu item. Enable it by going into “Tools” – “Options”, under “Projects and Solution” – “General” you check the “Show advanced build configurations” and click OK.
  3. Build your debug assembly files by clicking “Build” – “Build Solution” in the menu.
  4. Go to the “Debug” output directory of your project. Copy the assembly file (.dll) and the program debug database file (.pdb) containing your form and debugging information.
  5. Paste the files into the Service Manager install directory (normally “C:\Program Files\Microsoft System Center\Service Manager 2010″) on your Service Manager server.
  6. Open the Service Manager console.
  7. In Visual Studio go to “Tools” – “Attach to Process” and select the process called “Microsoft.EnterpriseManagement.ServiceManager.UI.Console.exe” and click “Attach”.
  8. You’re now ready to debug your custom form or task. Open up your custom form or click your custom task within the console and you should hit your break points within Visual Studio.
Comments (5)

After upgrading to ConfigMgr 2007 SP2 I’ve experienced that the database size was rapidly increasing. Microsoft has recently published a KB article KB978021 that will correct this, but there is nothing in the symptom description for the KB article that describes that the really big issue is that it can fill up your database disks. This is caused by the excessive logging from Distribution Manager of the message id’s 2300,2301 and 2342 caused by the bug.

So if you have upgraded to SP2 or are planning for an SP2 upgrade, make sure to install KB978021 hotfix as soon as possible on all site systems. A bonus is that it also corrects a memory leak that causes SMS Executive to crash periodically (see KB978022). If you have been running the ConfigMgr 2007 SP2 for a while without this hotfix and the database size has been growing a little too much. After applying the hotfix and made sure you have a working backup you can decrease the database file size and free up disk space by truncating the tables StatusMessageinsstrs, StatusMessages and StatusMessageAttributes and issue a shrink command on the ConfigMgr database.

IMPORTANT: By truncating these tables all status message history will be deleted, so be sure to have a valid backup before proceeding with this.

Comments (1)