Archive for May, 2009

Windows 2008 Perfmon Crashes – Reset User Defined Data Collector Sets

I discovered this very annoying bug in Windows Server 2008 when attempting to import an XML file with 100 serverswind2008 and counters in it.
No doubt one of the server had an issue and therefore and for some stupid reason, perfmon or Reliability And Performance Monitor, as its called now in 2008 is unable to handle this , and completely falls over.
Now, when you open Perfmon and try to view the User Defined Data Collector Sets, or run logman.exe from the command line, the application completely freezes and your unable to delete the corrupt dataset you just imported or even click elsewhere in the window.

In 2003, a reboot would fix this problem, but in 2008 it does not. The solution lies in the registry. Here’s how to fix the problem.

  1. Make sure your logged in as admin or with admin rights
  2. Close any open perfmon (Reliability and Performance Monitor) windows you have open.
  3. Click Start > Run then type  regedit hit enter
  4. Goto: HKLM\Software\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Windows\PLA
  5. You will see your Data Collector Sets in here, delete the one you created that caused the problem (or just delete them all if your not sure) **NOTE** Dont delete the “System” folder.
  6. Your done now, re-open perfmon, or logman and your problem should be solved.

SQL Replace Nulls With Blank String

Simple way to replace NULL values in your queries with blank strings by using the IsNull function.

This will allow for problem free string creation etc.

1
2
3
SELECT IsNull(ColumnName, '') 
As NewColumnName 
FROM TableName

More information can be found here: http://msdn.microsoft.com/en-us/library/ms184325.aspx

VBScript To Pull Events From Event Log And Email To Yourself – Past 24 Hours

So, you want to see what events have occured on a server in the past 24 hours. Maybe you have a problematic server, throwing errors but your event log is so massive , its hard to sort through.

This script will sift through your entire event log, searching for any events in the past 24 hours that match your event code, it will save the results to a .TXT file , and then email them to you. v.handy


Read more

VB.Net Forms Confirmation Box

How to create a simple confirmation box in a VB.Net WinForms application.    This will pop up a typical “Do You Wish To Continue ? ” Box , to which each button has a different action.


Read more