Deployment Solution

 View Only
Expand all | Collapse all

DS7.1 - Is it possible to have a task/script add a computer to a filter ???

  • 1.  DS7.1 - Is it possible to have a task/script add a computer to a filter ???

    Posted Sep 10, 2010 10:29 AM

    I am working on deploying Windows 7 with all the applications on it that we need at our company.
    We want to use Notification Server 7.0 and Deployment Solution 7.1 for this

    My sequence for making the image to install on new computers would be like this:
     1. Deploy a general image of Windows 7, not containing any software other than the Altiris Agent(s)
     2. Apply System Configuration to the new computer and join our domain
     3. Add the computer to a filter called "Windows 7 Standard Software", that will be used as target for our Standard software policies
     4. Wait until the Altiris Agent has installed everything that is needed
     5. Deliver computer to user
    Doing it this way would make the computer delivered to the user the same every time, as long as we dont "invent" new standard software

    What we have now, is a Windows 7 general image that can be deployed and joined to our domain (step 1 and 2)

    What I need help with is a way to add the new computer to the mentioned filter (Windows 7 Standard Software) with a task or a script or something automatically (step 3)
    I will then add the task/script to the deploy image job that I have

    Is this possible, and if it is, can anyone explain it to me ???



  • 2.  RE: DS7.1 - Is it possible to have a task/script add a computer to a filter ???
    Best Answer

    Posted Oct 11, 2010 07:37 AM

    It is possible with the help of ASDK and a little script.

     

    This is the script I ended up making

    ============================================================

    Option Explicit

    Const strFilterName = "<Name of the filter goes here>"

    Dim oCollectionManagement
    Dim oItemManagement

    Dim strItemName
    Dim colItems

    Dim itemComputer
    Dim itemComputerToAdd

    Dim itemFilter
    Dim itemFilterForAdding

    Set oCollectionManagement = CreateObject("Altiris.ASDK.NS.CollectionManagement")
    Set oItemManagement = CreateObject("Altiris.ASDK.NS.ItemManagement")

    oItemManagement.CreateLocalInstance()
    oCollectionManagement.CreateLocalInstance()

    strItemName = "%COMPNAME%"
    colItems = oItemManagement.GetItemsByName(strItemName)
    For Each itemComputer In colItems
    itemComputerToAdd = itemComputer.Guid
    Next

    strItemName = strFilterName
    colItems = oItemManagement.GetItemsByName(strItemName)
    For Each itemFilter In colItems
    itemFilterForAdding = itemFilter.Guid
    Next

    Call oCollectionManagement.AddInclusions(itemFilterForAdding, itemComputerToAdd)

    ============================================================

     

    This need to be run on a Task Server (New Task -> Run script on Task Server), and the Task Server needs to be able to find the ASDK.

    We have installed Workflow solution on our NS/Task Server, so it is available because of that.