[gptalk] Re: Add MSI package to GP

  • From: "Darren Mar-Elia" <darren@xxxxxxxxxx>
  • To: <gptalk@xxxxxxxxxxxxx>
  • Date: Wed, 26 Sep 2007 07:14:54 -0700

Ian-

The reality is that its not all present in MSDN, at least not in any obvious
way. The challenge of most of the GP areas is that they were each built by
different product teams, with no standards for setting storage or APIs used.
Creating packages in GPSI is one example. This particular area stores its
settings in both the GPC and GPT. The GPC contains a packageRegistration
object and stores a number of flags to represent the various options
available, in addition to the obvious path to the MSI. The GPT contains the
Application Advertisement Script (.aas), which is typically generated at
package creation time and takes into account any transforms that are added
to the package.  It would take me a lot of time to describe all of this in a
level of detail that would be actionable, but hopefully that information
gets you on a path of being able to investigate yourself. Its obviously not
impossible, but its not really documented in any way that shortcuts a lot of
sleuthing.

 

Darrne

 

 

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

 

Hi, Darren. Thanks for replying so promptly. I appreciate it.

 

I'd already come across your product in my Googling for a solution. In fact,
it's what spurred me on to ask this question: I figured since your product
existed, there has to be a way to do what I want.

 

For me, 'not very accessible' means 'accessible'. I have quite a bit of
stuff which people have said was impossible or hard to achieve so I'm
prepared to dig/hack/etc to get what I want. I'm well used to using
third-party tools (and build my own) to, for example, use Windows APIs in
VBS. In this case, though, I want to keep that to a minimum, as I'm working
for a client who is adverse to such things. There is no chance, for example,
that they'd spring for your Toolkit, as useful as it looks. So, what exactly
are the hurdles? Is it the traditional non-availability in VBS of C++ data
types and so on? If you have any docs on the interfaces I'd need to look at,
I'm more than happy to see what I can get done. Obviously it's all present
on MSDN but a pointer in the right direction would be very much appreciated.


 

Thanks again.

Ian

 

 

  _____  

From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx] On
Behalf Of Darren Mar-Elia
Sent: 26 September 2007 14:47
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] Re: Add MSI package to GP

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 
______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


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: