in reply to Error: Read a PPD for 'Win32-Lanman', but ..not intended ..for this build (MSWin32-x86-multi-thread-5.10)

You may want to look at some ready-made code, here in the Code Catacombs, NT Admin section:
Hardware/Software Inventory by shonorio.

Some code from the XP cookbook may help:

# From the book "Windows XP Cookbook" # ISBN: 0596007256 # Note that you cannot use this to connect to the local machine. # ------ SCRIPT CONFIGURATION ------ use Win32::OLE; $strServer = '<HostName>'; # e.g. wks01 $strUser = '<User>'; # e.g. AMER\rallen.adm $strPasswd = '<Password>'; # ------ END CONFIGURATION --------- $objLocator = Win32::OLE->new('WbemScripting.SWbemLocator'); $objWMI = $objLocator->ConnectServer($strServer, 'root\\cimv2', $strUs +er, $strPasswd); if ((0 + Win32::OLE::LastError()) != 0) { print 'Authentication failed: ' . ('' . Win32::OLE::LastError()), +"\n"; } # Now you can use the objWMI object to get an instance of a class # or perform a WQL query. Here is an example: $colDisks = $objWMI->InstancesOf('Win32_LogicalDisk')->Item;

     ..to maintain is to slowly feel your soul, sanity and sentience ebb away as you become one with the Evil.

  • Comment on Re: Error: Read a PPD for 'Win32-Lanman', but ..not intended ..for this build (MSWin32-x86-multi-thread-5.10)
  • Download Code

Replies are listed 'Best First'.
Re^2: Error: Read a PPD for 'Win32-Lanman', but ..not intended ..for this build (MSWin32-x86-multi-thread-5.10)
by gctaylor1 (Hermit) on Apr 28, 2009 at 02:09 UTC
    Thanks for the tip NetWallah. Unfortunately I'm not having much luck with this example. I get a  Use of unintialized value $colDisks in concatenation (.) or string at line 27.error. I did get one of the examples to work so it's not all bad. I think I'll need to suck it up and study COM and/or Windows scripting stuff for a while to understand what WMI and SWbemServices are. Maybe then I'll have a clue.

    If anyone reading this might have a tip for a good book on this, that would be good. I'm not a programmer(Yet. That's why I'm studying Perl) so I assume it would have to be VB, VBscript, or something basic like that. As opposed to .net?