Client Management Suite

 View Only
  • 1.  Add Computer to Filter /task

    Posted Jun 04, 2012 11:21 AM

    Hi,

     

    this problem is discussed more than one times, but I can't find a solution.
    Im' lokking for a way to put my clients during the Installation in a special filter.
    The task works fine for the clients which are connected directly to the NS (TaskServer).

    If the Clients are connected to another TaskServer (SiteServer), the task failed. I've installed all of the four ASDK Components at the Site Server.

    My Environment is 7.1SP1

    -------------------------------------------------------

    Option Explicit

    Const strFilterName = "My Filter"

    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)
    Call oCollectionManagement.UpdateCollections(itemFilterForAdding)

    -----------------------------------------------------------------------------



  • 2.  RE: Add Computer to Filter /task

    Posted Jun 04, 2012 12:46 PM

    I've found one mistake.
    After adding this informations, it works on the SiteServer where the ASDK packages are installed.
    But it's very critical to transmit Username and password as clear text.
    Any ideas??

    ItemManagement.TargetServer  = "IP-Adress"
    itemManagement.UserName = "Username"
    itemManagement.Password = "Password"
    itemManagement.DomainName = "Domain"
    itemManagement.Authenticate()

     



  • 3.  RE: Add Computer to Filter /task
    Best Answer

    Posted Jun 05, 2012 12:01 PM

    My Solution,

    If you edit the "Altiris Host Object Servcie" go to LogOn and choos the altiris Service account instead of the System account, All works fine.

    You only need:

    ItemManagement.TargetServer  = "%NSSERVER%"
    itemManagement.Authenticate()

     

    Thats all. The VB-Script run as the Service Account and has the right credentials.