Before you can do any WMI script, it is best to check that you client is enabled for WMI.

Windows XP and 2000 have WMI installed by default, any other OS will need the WMI client which can be download from the microsoft site.

Also have a look at KiXoMatic.