Dan Thomson at myITforum.com

Pacifying the call of an undying passion

Syndication

News


    If they don't find you handsome, maybe they'll find you handy (Red Green).
    Proud member of the myITforum Network

Links: Helpful forums

Links: Interesting blogs

Links: User Groups

Stuff I do

May 2006 - Posts

Detecting if a reboot is required: Leveraging Update Services

In my quest to find the best method(s) for detecting if a system reboot is required, I came across the RebootNeeded script at www.wsus.nl.

This function determines if a reboot is needed due installation of patches.

Example


C:\>cscript //nologo Function_RebootNeeded.vbs
No reboot required!

Code


'************* Example *************
If RebootNeeded() Then
   Wscript.Echo "A reboot is needed to complete the installation."
Else
   Wscript.Echo "No reboot required!"
End If 

'****************************************************************************
' Function RebootNeeded()
'
' Checks if a reboot is needed.
'****************************************************************************
Function RebootNeeded()

   On Error Resume Next
  
   Dim objSystemInfo
   Dim flgRebootNeeded
   
   flgRebootNeeded = False
   Set objSystemInfo = WScript.CreateObject("Microsoft.Update.SystemInfo")
   If Err.Number <> 0 Then
      Wscript.Echo "Error creating [Microsoft.Update.SystemInfo] object 0x" & Right("0000000" & Hex(Err.Number), 8) & ": " & Err.Description
      Err.Clear
   End If
   flgRebootNeeded = objSystemInfo.rebootrequired
   Set objSystemInfo = Nothing

   RebootNeeded = flgRebootNeeded

End Function

It is probably not evident from the code in the sample above, but the script must be run from the local system to determine if it requires a reboot for a patch to become fully installed.

There is another script (PatchesInstalling) over at the www.wsus.nl site which will determine if a patch installation is in progress.

Posted Monday, May 22, 2006 1:09 AM by dthomson | with no comments

Filed under:

Some new SMS tools on the block

I saw this blog post over at the Blogcast Repository the other day by Wayne Grixti. The post mentions a new SMS 2003 Client tool which was recently updated. Of course I had to check it out since I'm always open to better ways of doing things and also like to check out what other folks are doing in the community.

What I found were a bunch of tools which are being developed by Roger Zander and posted to www.SourceForge.net.

They are:

Even though I haven't had a change to give any of the tools a whirl, they do seem very intriguing. I suggest you go check them out and see if they warrant being included into your toolbox of applications.

Posted Sunday, May 21, 2006 11:21 PM by dthomson | with no comments

Filed under:

PowerShell Analyzer

I was jumping around the Internet recently and came across Karl Prosser's blog. He has a pretty cool tool that he is developing for PowerShell. It is called the PowerShell Analyzer and is a graphical interface for editing and running PowerShell scripts.

Anyone interested in getting onboard with PowerShell scripting will want ot add this to their list of must have tools.

Here are a couple links:

Posted Sunday, May 21, 2006 11:11 PM by dthomson | with no comments

Filed under:

Any interest: A tool to manage Windows OS networking settings?
I have a fairly large vbscript which can manage networking settings of the local system, or one or more remote systems. I have used the script a good bit to configure networking during Sysprep and have also used it to modify networking settings on remote PC's to accommodate infrastructure changes. Let me know if you are interested in the script. If there is enough interest, I might even convert the code to an hta or even a VB.Net coded app.

Posted Saturday, May 20, 2006 6:44 PM by dthomson | 1 comment(s)

Filed under:

Why is Outlook Express installed by default on Windows Server 2003?
Is it me, or does the fact that Outlook Express is installed during a default installation of Windows Server 2003 SP1 bother you too? I know I can go in after the fact and edit the sysoc.inf file to show Outlook Express in the Add/Remove Windows Components dialog. I could even edit some source files prior to install to customize the resulting installation. However, I am with the mindset that some of the installation components which are hidden by sysoc.inf should be shown during install time.

Posted Saturday, May 20, 2006 6:43 PM by dthomson | with no comments

Filed under:

Enhancing code performance when working with databases

I was visiting www.allapi.com last night and came across this little tip on how to speed up code which performs actions against a database.

Instead of coding as follows:

Do While Not objRecordset.EOF

'Perform some action

Loop

It is suggested that there can be as much as a 33% performance increase if the code is written as follows:

objRecordset.MoveLast

intRecordCount = objRecordset.RecordCount

objRecordset.MoveFirst

For intCounter = 1 To intRecordCount

'Perform some action

objRecordset.MoveNext

Next

****

 OR

****

intRecordCount = objRecordset.Count

For intCounter = 1 To intRecordCount

'Perform some action

objRecordset.MoveNext

Next

The reason given for the potential performance gain is that every time the code goes through the loop in the first example, it has to determine if it is at the end of file. This is no longer done if using the second example. I haven't compared the performance of these methods, but the premise sounds logical.

The AllAPI site is geared toward Visual Basic 6.

Please visit the MSDN section Microsoft ActiveX Data Objects for information on using ADO in your code.

Posted Sunday, May 14, 2006 4:43 PM by dthomson | with no comments

Filed under: