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)
-----------------------------------------------------------------------------