Video Screencast Help

Patch Management Solution Automation Tools for Patch Management Solution 6.2

Created: 28 Oct 2009 • Updated: 25 Nov 2009 | 5 comments
Language Translations
Ludovic Ferre's picture
+6 6 Votes
Login to vote

Document sections:

Command line arguments

/task:EnableAll
/task:DisableAll
/task:CreateAllTasks

Note: The following command line examples assume that the Notification Server install directory is under the system folder %programfiles%. If you have installed the Notification Server on a different drive change the path accordingly.

Back to top

Command line usage examples

So to enable all bulletins in a Patch Management Solution copy the nscript.nrf and pms62auto.cs onto '%programfiles%\Altiris\Notification Server\bin' and run the following command line:

"%programfiles%\Altiris\Notification Server\bin\nscript.exe" pms62auto.cs /task:EnableAll

To disable all bulletins use the following command line:

"%programfiles%\Altiris\Notification Server\bin\nscript.exe" pms62auto.cs /task:DisableAll

To create a Software Update task for all bulletin (that do not have an update task created and that are enabled and that have downloaded all update files) run the following command line:

"%programfiles%\Altiris\Notification Server\bin\nscript.exe" pms62auto.cs /task:CreateAllTasks

Back to top

SQL Query within the cs file

Additionally you can control the bulletins to be enable or disabled by changing the SQL statement to suit your needs. Below in red is a sample modification to the pms62auto.cs, with the SQL statement in blue and modified elements in red :

        public static GuidCollection GetSoftwareBulletins() 
        { 
            GuidCollection gcResources = new GuidCollection(); 
            string strSelect = @" 
SELECT ItemResource.Guid, vItem.Name FROM ItemResource 
        join Inv_Software_Bulletin on ItemResource.Guid = Inv_Software_Bulletin._ResourceGuid 
        join ItemActive on ItemResource.Guid = ItemActive.Guid 
        join vItem on ItemResource.Guid = vItem.Guid 
WHERE ItemResource.ResourceTypeGuid = @resourceTypeGuid 
  and Deleted = 0 and Enabled = 1
  and vItem.Name in ('MS07-033','MS07-024','MS07-012','MS06-50','KB-923097','KB-913807') 
ORDER BY FirstReleaseDate DESC, vItem.Name DESC

Back to top

SQL query change example

If you want to test the SQL query on the server before executing you can use the following SQL statement and modify the where close to suit your needs:

SELECT ItemResource.Guid, vItem.Name
 FROM ItemResource 
        join Inv_Software_Bulletin on ItemResource.Guid = Inv_Software_Bulletin._ResourceGuid 
        join ItemActive on ItemResource.Guid = ItemActive.Guid 
        join vItem on ItemResource.Guid = vItem.Guid 
WHERE ItemResource.ResourceTypeGuid = '3063DB82-7011-4A03-86CA-7BE49FB749CC' 
  and Deleted = 0 and Enabled = 1 
  and vItem.Name in ('MS07-033','MS07-024','MS07-012','MS06-50','KB-923097','KB-913807') 
ORDER BY FirstReleaseDate DESC, vItem.Name DESC

Back to top

File list

  • nscript.nrf
  • pms62auto.cs
  • pms62auto_howto.html

The nscript.nrf file list the assemblies that should be loaded by nscripts (PMS 6.2 assemblies), while the pms62auto.cs was written to provide a one-stop shop for most automation tasks. So it takes certain command line arguments (which are case sensitive) as described below.

Back to top

Comments 5 CommentsJump to latest comment

G Ross's picture

If you ran task:CreateAllTasks it would create a single task of all enabled and downloaded bulletins in your Patch Management soluiton?  Alternatively if you selected individual bulletins in the SQL script it would create a single task just for those bulletins defined in the SQL script (assuming they are already enabled/downloaded)?

thanks

+1
Login to vote
Ludovic Ferre's picture

 Hi G Ross,

If you run task:CreateAllTasks it would created one task per bulletin that are enabled and in the SQL query.

As you stated you could easily modify the targetted bulletins to match a single entry on the SQL or you could extend the script adding an input parameter to specify the bulletin you need and replace a variable in the SQL query definition.

I used this script last week and it worked as it always did (I had not used it for a year at least) so I ended up with 11GB of patches on my NS ;).

I am currently off-net, on a retreat of some kind. I'll be back real soon, and you sure will hear from me then ;-).

Ludovic FERRÉ
Principal Remote Product Specialist
Symantec

+1
Login to vote
Ian_C.'s picture

Still useful, even today.

Please mark the post that best solves your problem as the answer to this thread.
0
Login to vote