Archive for January, 2010
Dots messing up your binding path
Posted by: | CommentsWhen 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!
OK
<Property ID=“MyDate“ Type=“datetime” />
<Property ID=“Prefix_MyDate“ Type=“datetime” />
Not OK!!!
<Property ID=“Prefix.MyDate“ Type=“datetime” />
Related dates in Service Manager views
Posted by: | CommentsMy 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.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 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) Else 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 wscript.quit(strExitCode) |
Debugging custom forms and console tasks in Service Manager
Posted by: | CommentsWhen 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.
- In the code behind, add suitable breakpoints.
- 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. - Build your debug assembly files by clicking “Build” – “Build Solution” in the menu.
- 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.
- Paste the files into the Service Manager install directory (normally “C:\Program Files\Microsoft System Center\Service Manager 2010″) on your Service Manager server.
- Open the Service Manager console.
- In Visual Studio go to “Tools” – “Attach to Process” and select the process called “Microsoft.EnterpriseManagement.ServiceManager.UI.Console.exe” and click “Attach”.
- 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.