1 Reply Latest reply on Dec 13, 2012 2:01 PM by zman

    Adding GPOs to inventory data?

    BryanS Apprentice

      I want to be able to add a list of all the GPOs applied to a computer object into inventory so I can query for computers that are missing a desired GPO or computers that have a particular GPO applied to them.  I've been struggling with using LDSCNHLP.INI to execute gpresult.exe and am tempted to try going the route of adding the data to the registry and then using the ldappl3.template to harvest the data from there.  It seems like that is an inferior route since I still need a seperate process to put the data into the registry and it wouldn't be as dynamic since I'd have to rerun that process to refresh the registry values.


      I'm curious if anyone has experience with using LDSCNHLP.INI to perform this sort of activity.


      So far, I've got the following added to my LDSCNHLP.INI file:


      [EXECUTE WIN16]



      [EXECUTE WIN32]

      LAUNCH1=c:\windows\system32\gpresult.exe /SCOPE COMPUTER > C:\PROGRA~2\LANDesk\LDClient\gpos.txt

      [DATA FILES]




      My intent is to capture the output from gpresult and send it to gpos.txt, then have that data added to inventory.  I'm running inventory scan with a /o to send my scan results to a text file I can review so I know it's not a matter of the data being blocked.  When I run inventory scan (as admin so I get gpresult running as admin to gather the computer data) I see the hardware section indicate that it's "running custom scanners" and I do see a terminal box pop up for a moment but I don't see gpresult running in the task manager. It proceeds through the rest of the scan and I see output that is the same as any without these entries in LDSCNHLP.INI.


      I don't think I'm actually running gpresult and I'm curious if I add it to a  batch file with the switches, if maybe the switches are messing it up.  I'm also concerned about the formatting of the output but until I'm getting output I'm not ready to address that worry.


      Any guidance on doing this?



        • 1. Re: Adding GPOs to inventory data?
          zman Master

          So a couple of items. I would review this document. http://community.landesk.com/support/docs/DOC-5730 espially format of data files. You will have to scrub the data file into the proper format. This means you will have to write a secondary script to take your gpos.txt file and extract the pertinent data and insert it into the gpos.txt in the proper format. Also the commandline options are somewhat different for Windows 7. One thing in Vista/Windows 7 is you can use the /x option to export in XML which MAY be easier to manage.