Client Management Suite

 View Only
  • 1.  ASDK not working on Site Server

    Posted Jun 04, 2012 05:35 AM

    Hi,

    I've a Task that moves a client during INstalaltion in a special Filter.
    That works fine on the NS. But if I run this Task against a client which is connected to an site server, an error occurs.
    I've installed all of the four ASDK packages on the Site Server.

    The NS is an Win2008R2 x64 and also the Site Server.

    This is the VB-Script I'm runing as an Script executes on the Task Server

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

    Option Explicit

    Const strFilterName = "Default_Install_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)

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

     

    Any Ideas??

     

    Thanks



  • 2.  RE: ASDK not working on Site Server

    Posted Jul 12, 2012 03:18 AM

    I dont think that will work with local instances on a site server.

    replace your 

    oCollectionManagement.CreateLocalInstance()

    with

     

    ocollectionManagement.TargetServer = NS
    ocollectionManagement.UserName = SMPaccount
    ocollectionManagement.Password = PW
    ocollectionManagement.DomainName = Domain
    ocollectionManagement.Authenticate()
     
    same for the Itemmanagement also if you make it a taskserver script you can target computers with it and catch the GUID with the '%COMPUTERID%' Token