[gptalk] Re: Add MSI package to GP

  • From: "Darren Mar-Elia" <darren@xxxxxxxxxx>
  • To: <gptalk@xxxxxxxxxxxxx>
  • Date: Wed, 26 Sep 2007 06:47:22 -0700

Ian-

Would that it would be that simple! There are no scripting APIs available
out of the box to create GPSI packages. Its definitely not trivial, I can
tell you that. This is why my company created the GPExpert Scripting Toolkit
product, to provide a common interface into all GP settings. For the most
part, none of the policy areas are exposed in any easy way. You can
certainly get to some of them using C++ interfaces but from VBScript, its
not very accessible. Sorry for the bad news.

 

Darren

 

 

****

Darren Mar-Elia

CTO & Founder

SDM Software, Inc.

www.sdmsoftware.com

Finally, script Group Policy Settings with the NEW GPexpertT Scripting
Toolkit For PowerShell at http://www.sdmsoftware.com/products2.php!

 

 

 

 

 

From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx] On
Behalf Of Northwood, Ian
Sent: Wednesday, September 26, 2007 4:56 AM
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] Add MSI package to GP

 

I'm writing a script (VBScript) to automate as much as possible of our
'preparation for deployment' process, mostly so we can impose standards and
stop packagers using ridiculous names for GPOs! 

 

So far, the script creates the group, sets up the GPO, links the GPO to the
relevant OU, removes 'Authenticated Users' from the permission list and adds
the group created in the first step. That all works.

 

Now, I need ti make it add the MSI to the GPO. Does anyone have any pointers
about this? I've looked at the GPMgmt.GPM object docs on MSDN but that
doesn't seem to have anything which looks like it might do the job. 

 

I imagine I'd need to use the GPO's GUID (which the script stores already)
somewhere but what do I do with it? Do I have to add every property that I
can see in ADSIEdit? Surely not? There must be an 'Add' method or something
somewhere...

 

I have the shell of a function which looks like this:

 

Function AddPackageToGPO(ByVal strDomain, ByVal strGUID, ByVal blnPerUser)
 Dim strTarget

 

 strTarget    = "CN=Packages,CN=Class Store""
 
 If blnPerUser Then
  strTarget   = strTarget & ",CN=User"
 Else
  strTarget   = strTarget & ",CN=Machine"
 End If
 
 strTarget    = strTarget & ",CN=" & strGUID & ",CN=Policies,CN=System," &
strDomain

 

 AddPackageToGPO    = False

 

 AddPackageToGPO    = True

 

End Function

 

 

All I need is the rest! :) Can this even be done in script? I can't believe
it can't be...


Liverpool Victoria Friendly Society Ltd. Registered in England and Wales.
Registered Office: County Gates Bournemouth England, BH1 2NF, No.61 Coll.
Financial Services Authority Register number 110035. 

This email (and any attachments):

- is for its intended recipients only and may contain confidential and /or
legally privileged information. If received in error, any use of this email
is prohibited. Please delete it (and any copies) and notify us on +44(0)1202
292333, ext. 4044. 

- is believed to be free of any virus or other defect but internet
communications cannot be guaranteed to be secure or error free and we do not
accept any liability for any loss or damage from their receipt or use. 

Opinions expressed in this email are not necessarily those of the Society. 
LV= and Liverpool Victoria are trade marks of Liverpool Victoria Friendly
Society Limited and LV= and LV= Liverpool Victoria are trading styles of the
Liverpool Victoria group of companies.
LV= reserves the right to monitor and inspect emails sent to and by its
employees.

To find out more about us please visit: www.lv.com <http://www.lv.com/>  
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Other related posts: