Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Repository automation

Updated: 21 May 2010 | 6 comments
VBScab's picture
0 0 Votes
Login to vote

In my perigrinations around our Projects folder, it appears that a substantial number of packages haven't been imported into the Software Manager database. I want to build a script that will produce a list of packages which i can then match against the Project folders. Luckily, we have managed to impose a naming convention, meaning that that mapping should be pretty straightforward.



The RepositoryCOM "Help" file is useless for a VBScripter like me, as I have only the vaguest clue how to translate C# into VBS. This sample looks like it could be turned to my advantage:



RepositoryClass rc = new Repository.RepositoryClass();

rc.Connect(@"\\PackageStudioServer\Wise Share Point",false);

Repository.PackageCollection Filtered2 = rc.FilteredPackages("APPLICATIONNAME = 'XP hotfixes'");

foreach (Repository.Package pack in Filtered2)

{

Object cs;

package.Read("MSIPRODUCTCODE",out cs,null);

Trace.WriteLine("package: " + pack.Name + " ProductCode: " + cs.ToString() );

}




I got as far as:



Set rc = New Repository.RepositoryClass

rc.Connect(@""\\PackageStudioServer\Wise Share Point",false)
but then come to a juddering halt.



BTW, I found the Altiris KB 'Search' next to useless, as usual. It didn't even turn up the documentation, much less any samples.



Any guidance that can be offered would be very much appreciated.

discussion Filed Under:

Comments

EdT's picture
17
Sep
2008
0 Votes 0
Login to vote

Are you looking for a script to check the list of packages in the SQL database?

You should be able to retrieve this information using normal SQL calls, or install the SQL tools and use them.

Or have I totally misunderstood the question??

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

VBScab's picture
18
Sep
2008
0 Votes 0
Login to vote

quote:
Originally posted by: EdT

Are you looking for a script to check the list of packages in the SQL database?

You should be able to retrieve this information using normal SQL calls, or install the SQL tools and use them.

Yes to the first and to the second, where's the fun in THAT?!?



Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.

EdT's picture
18
Sep
2008
0 Votes 0
Login to vote

Well, it's a change from sticking pins in your eyeballs.....

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

John McFadyen's picture
24
Sep
2008
0 Votes 0
Login to vote

Ian,



Its about time you opened up VS. Its not that big a leap from vbscript, admittedly the interface looks a little daunting when your used to looking at notepad to write code.



If you like I can give some some sample code you would be familiar with to help you get started. Over the weekend I can give you some tutorage around the interface, once you get that sorted it doesn't seem as scary as it looks.



I picked it up in a few days I have complete confidence you could do the same as your one of the better scripters on this forum i dont see it challenging you too much.





J





VBScab's picture
24
Sep
2008
0 Votes 0
Login to vote

Actually, John, I'm a long-term user of VS, but VB and VB.Net, not any of the C variants. I simply can't be doing with languages which have such arcane syntax and (what are to me) bizarre "rules."



I've never swallowed the argument that C/C+/C++/C# can do things which VB can't. OK, maybe VB needs help along the way (I'm thinking of things like the popular sub-classing kludges) but I've never come across anything I couldn't do in VB.



You can lock this thread, BTW: my client has dramatically brought forward a roll-out deadline for a site which has been bubbling quietly for the last year or so, so I'm going to be too busy to look at this in anything like a reasonable time-frame.



Thanks for the offer, though. I always appreciate your help and advice.

Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.

EdT's picture
24
Sep
2008
0 Votes 0
Login to vote

I hope your overtime is at double rate then!

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.