Archive for November, 2006


Im pleased to announce that My Remote Command Executor Project RemCom is now officially being used in Open Computer and Software Inventory  Next Generation Project , which is one of the most widely used and successful hardware / software inventory, configuration and patch management open source project on sourceforge. You can see the link on this page for credits.

Special Thanks to Emmanuel GUILLORY of the OCS Inv Project for her insightful suggestions, recommendations and help.

powered by performancing firefox

My New Desktop

Posted: November 19, 2006 in My Grafix

Accessing WMI Settings through WMI

Posted: November 12, 2006 in Security

Perl Version:

use strict;

use Win32::OLE(‘in’);

use constant wbemFlagReturnImmediately => 0×10;
use constant wbemFlagForwardOnly => 0×20;

my @computers = (“localhost”);
foreach my $computer (@computers)
{
print “\n”;
print “==========================================\n”;
print “Computer: $computer\n”;
print “==========================================\n”;

my $objWMIService =
Win32::OLE->GetObject(“winmgmts:\\\\$computer\\root\\CIMV2″)
or die “WMI connection failed.\n”;
my $colItems =
$objWMIService->ExecQuery(“SELECT * FROM Win32_WMISetting”, “WQL”,
wbemFlagReturnImmediately | wbemFlagForwardOnly);

foreach my $objItem (in $colItems)
{
print “ASPScriptDefaultNamespace: $objItem->{ASPScriptDefaultNamespace}\n”;
print “ASPScriptEnabled: $objItem->{ASPScriptEnabled}\n”;
print “AutorecoverMofs: ” . join(“,”, (in $objItem->{AutorecoverMofs})) . “\n”;
print “AutoStartWin9X: $objItem->{AutoStartWin9X}\n”;
print “BackupInterval: $objItem->{BackupInterval}\n”;
print “BackupLastTime: $objItem->{BackupLastTime}\n”;
print “BuildVersion: $objItem->{BuildVersion}\n”;
print “Caption: $objItem->{Caption}\n”;
print “DatabaseDirectory: $objItem->{DatabaseDirectory}\n”;
print “DatabaseMaxSize: $objItem->{DatabaseMaxSize}\n”;
print “Description: $objItem->{Description}\n”;
print “EnableAnonWin9xConnections: $objItem->{EnableAnonWin9xConnections}\n”;
print “EnableEvents: $objItem->{EnableEvents}\n”;
print “EnableStartupHeapPreallocation: $objItem->{EnableStartupHeapPreallocation}\n”;
print “HighThresholdOnClientObjects: $objItem->{HighThresholdOnClientObjects}\n”;
print “HighThresholdOnEvents: $objItem->{HighThresholdOnEvents}\n”;
print “InstallationDirectory: $objItem->{InstallationDirectory}\n”;
print “LastStartupHeapPreallocation: $objItem->{LastStartupHeapPreallocation}\n”;
print “LoggingDirectory: $objItem->{LoggingDirectory}\n”;
print “LoggingLevel: $objItem->{LoggingLevel}\n”;
print “LowThresholdOnClientObjects: $objItem->{LowThresholdOnClientObjects}\n”;
print “LowThresholdOnEvents: $objItem->{LowThresholdOnEvents}\n”;
print “MaxLogFileSize: $objItem->{MaxLogFileSize}\n”;
print “MaxWaitOnClientObjects: $objItem->{MaxWaitOnClientObjects}\n”;
print “MaxWaitOnEvents: $objItem->{MaxWaitOnEvents}\n”;
print “MofSelfInstallDirectory: $objItem->{MofSelfInstallDirectory}\n”;
print “SettingID: $objItem->{SettingID}\n”;
print “\n”;
}

}

C# Version:

Code Generated by iSuite Network Utils – WMI Code Gen by NCR iSuite Team
Author: Talha Tariq

Code Generation at: 11/22/2006 8:30:24 PM
*/

using System;
using System.Management;
using System.Windows.Forms;

public class WMIQuery
{
public static void Main()
{
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher(“root\\CIMV2″,
“SELECT * FROM Win32_WMISetting”);

foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine(“———————————–”);
Console.WriteLine(“Win32_WMISetting instance”);
Console.WriteLine(“———————————–”);
Console.WriteLine(“ASPScriptDefaultNamespace: {0}”, queryObj["ASPScriptDefaultNamespace"]);
Console.WriteLine(“ASPScriptEnabled: {0}”, queryObj["ASPScriptEnabled"]);

if(queryObj["AutorecoverMofs"] == null)
Console.WriteLine(“AutorecoverMofs: {0}”, queryObj["AutorecoverMofs"]);
else
{
String[] arrAutorecoverMofs = (String[])(queryObj["AutorecoverMofs"]);
foreach (String arrValue in arrAutorecoverMofs)
{
Console.WriteLine(“AutorecoverMofs: {0}”, arrValue);
}
}
Console.WriteLine(“AutoStartWin9X: {0}”, queryObj["AutoStartWin9X"]);
Console.WriteLine(“BackupInterval: {0}”, queryObj["BackupInterval"]);
Console.WriteLine(“BackupLastTime: {0}”, queryObj["BackupLastTime"]);
Console.WriteLine(“BuildVersion: {0}”, queryObj["BuildVersion"]);
Console.WriteLine(“Caption: {0}”, queryObj["Caption"]);
Console.WriteLine(“DatabaseDirectory: {0}”, queryObj["DatabaseDirectory"]);
Console.WriteLine(“DatabaseMaxSize: {0}”, queryObj["DatabaseMaxSize"]);
Console.WriteLine(“Description: {0}”, queryObj["Description"]);
Console.WriteLine(“EnableAnonWin9xConnections: {0}”, queryObj["EnableAnonWin9xConnections"]);
Console.WriteLine(“EnableEvents: {0}”, queryObj["EnableEvents"]);
Console.WriteLine(“EnableStartupHeapPreallocation: {0}”, queryObj["EnableStartupHeapPreallocation"]);
Console.WriteLine(“HighThresholdOnClientObjects: {0}”, queryObj["HighThresholdOnClientObjects"]);
Console.WriteLine(“HighThresholdOnEvents: {0}”, queryObj["HighThresholdOnEvents"]);
Console.WriteLine(“InstallationDirectory: {0}”, queryObj["InstallationDirectory"]);
Console.WriteLine(“LastStartupHeapPreallocation: {0}”, queryObj["LastStartupHeapPreallocation"]);
Console.WriteLine(“LoggingDirectory: {0}”, queryObj["LoggingDirectory"]);
Console.WriteLine(“LoggingLevel: {0}”, queryObj["LoggingLevel"]);
Console.WriteLine(“LowThresholdOnClientObjects: {0}”, queryObj["LowThresholdOnClientObjects"]);
Console.WriteLine(“LowThresholdOnEvents: {0}”, queryObj["LowThresholdOnEvents"]);
Console.WriteLine(“MaxLogFileSize: {0}”, queryObj["MaxLogFileSize"]);
Console.WriteLine(“MaxWaitOnClientObjects: {0}”, queryObj["MaxWaitOnClientObjects"]);
Console.WriteLine(“MaxWaitOnEvents: {0}”, queryObj["MaxWaitOnEvents"]);
Console.WriteLine(“MofSelfInstallDirectory: {0}”, queryObj["MofSelfInstallDirectory"]);
Console.WriteLine(“SettingID: {0}”, queryObj["SettingID"]);
}
}
catch (ManagementException e)
{
MessageBox.Show(“An error occurred while querying for WMI data: ” + e.Message);
}
}
}

Blogged with Flock


I was recently requested that the liscencing of RCE (GPL Liscence) is too restrictive. I do not wish to debate over the difference liscences available for the open source community, yet I personally believe any kind of a restrictive clause in a liscence hurts the cause and the spirit of the foundation on which free software movement was built.

I tend to be quite flexible in distributing whatever code i write, so even though i was informed that my code will be used in a closed source proprietry application, still i did not hesitate in changing the liscencing structure.

So as of today, RCE is available under a revised BSD liscence.