Symantec Developer Group

  • 1.  Change asset status with ASDK 7.x

    Posted 02-05-2015 09:42 AM

    Hello,

    I need to change asset status for example from 'Active' to 'Retired' using ASDK webservices. I looked over the ASDK help. The ItemManagement or Resource Management does not seem to offer any suitable methods.

    Any advice ?

    Thank you,

    Tomasz



  • 2.  RE: Change asset status with ASDK 7.x

    Broadcom Employee
    Posted 02-17-2015 05:38 AM
    assetManagement.Authenticate()
    assetManagement.SetTimeOut(180000)
    errorReturn = assetManagement.SetAssetStatus(strGuid, "Active")    
    If errorReturn Then 
     wscript.echo "Successfully set asset status on " & strName
    Else
     wscript.echo "Not  set asset status on " & strName
    End If
    set assetManagement = Nothing


  • 3.  RE: Change asset status with ASDK 7.x

    Posted 03-18-2015 08:28 AM

    Safy,

    Thanks for the tip. But the trouble I am facing is that ASDK 7.1 and 7.5 does not seem to offer any API to manage assets. The discussion on altirigos.com is dated as of 2009.

    Do you know what is the webservices address for asset managent ?

    For example here is couple for others.

    NS Web Service URLs

    Web Service Name

    URL

    Collection Management

    http://localhost/Altiris/ASDK.NS/CollectionManagementService.asmx

    Hierarchy Management

    http://localhost/Altiris/ASDK.NS/HierarchyManagementService.asmx

    Item Management

    http://localhost/Altiris/ASDK.NS/ItemManagementService.asmx

    Report Management

    http://localhost/Altiris/ASDK.NS/ReportManagementService.asmx

    Resource Management

    http://localhost/Altiris/ASDK.NS/ResourceManagementService.asmx

    Scoping Management

    http://localhost/Altiris/ASDK.NS/ScopingManagementService.asmx

    Security Management

    http://localhost/Altiris/ASDK.NS/SecurityManagementService.asmx

    Asset management does not seem to exist at all on 7.x :(

    Any ideas ?

    thanks,

    Tomasz 



  • 4.  RE: Change asset status with ASDK 7.x

    Posted 03-24-2015 07:53 AM

    So maybe somebody knows in wchich SQL table the asset status is stored ?

    I do not like it but I could use the SQL connector and Workflow server to modify the values directly in the tables.



  • 5.  RE: Change asset status with ASDK 7.x
    Best Answer

    Trusted Advisor
    Posted 04-24-2015 09:48 AM

    There are also the Asset.png 'Get Status For Asset By Id Component' and Asset.png 'Set Status For Asset Component' which you could use.

    Class: Altiris7.ResourceComponents.SetStatusForAssetComponent
    Library: Symantec.Components.Generated7.Altiris.Resource.dll



  • 6.  RE: Change asset status with ASDK 7.x

    Trusted Advisor
    Posted 04-24-2015 10:07 AM

    If you want to see a Computer's Status:

    Go to the Resource:

    Folder.png Settings | Folder.png Notification Server | Folder.png Resource and Data Class Settings | Folder.png Resource Types | Folder.png Asset Types | Folder.png IT | Computer.png Computer

    The Asset's Status is a Resource Association.

    Folder.png SettingsFolder.png Notification Server | Folder.png Resource and Data Class SettingsFolder.png Resource AssociationsResource Association.png Asset’s Status

    This shows the Association of Asset to Fixed Asset Status Resource Type

    Grab the GUID for later.

     

    Using the ResourceType Table you can find where this information is stored:

    SELECT ResourceTypeViewName, ResourceItemViewName, * 
    FROM [ResourceType] 
    WHERE [Name] LIKE '%Fixed Asset Status%'
    ResourceTypeViewName ResourceItemViewName
    vRM_Fixed_Asset_Status_Resource_Type vRM_Fixed_Asset_Status_Resource_Type_Item

    From here look in: vRM_Fixed_Asset_Status_Resource_Type_Item to get your list of Statuses.

    Name
    Active
    Retired

    You can then use the ResourceAssociation Table to see each Computer's Status:

    SELECT 
        RM_ResourceComputer.Name AS [ComputerName], 
        vRM_Fixed_Asset_Status_Resource_Type_Item.Name AS [Status]
    FROM ResourceAssociation 
     INNER JOIN RM_ResourceComputer ON ResourceAssociation.ParentResourceGuid = RM_ResourceComputer.Guid 
     INNER JOIN vRM_Fixed_Asset_Status_Resource_Type_Item 
     ON ResourceAssociation.ChildResourceGuid = vRM_Fixed_Asset_Status_Resource_Type_Item.Guid
    WHERE
     (ResourceAssociation.ResourceAssociationTypeGuid = '3028166f-c0d6-41d8-9cb7-f64852e0fd01')
    

     



  • 7.  RE: Change asset status with ASDK 7.x

    Posted 04-29-2015 03:07 PM

    do you want to just set the asset status in the asset tables ? I have done this through a sql script that is scheduled 

     



  • 8.  RE: Change asset status with ASDK 7.x

    Broadcom Employee
    Posted 05-28-2015 11:48 AM

    Hi there,

     

    This looks interesting.  I am trying to do something similar with our estate.  We have Asset Management on the Parent server but not the Child servers.  So we don't have the Asset Job to retire the machines, but using the ASDK to do this might be just the ticket.

    I was just going to use a SQL job to dp this, but doing an SQL trace on the right click event has some other things around the replication sp REPinvaidateAll firing off as the same time as the right click to retire is run.

    I have stared building a .Net application that will take a set of records and update the status of the machines.  I'm having trouble with the Library reference.  Its coming back the Logic.core is missing

    Kind regard



  • 9.  RE: Change asset status with ASDK 7.x

    Posted 07-10-2015 09:48 AM

    Hi Alex,

    Thank you for your suggestions. The given sql query return only assets if you have already changed the asset's status at least once, even if you click 'edit' and see the active status with your eyes. The 'Get Status For Asset By Id Component' has the same weakness. If you have not set the status directly before, those methods do not give you any useful information. 'Set Status For Asset Component' works fine for me. So I can set the pc as 'Retired' first and then confirm it is retired with 'Get status for Assest by ID' component. It is the closest I can get to my goal.

    I also found the 'vComputerAnyStatus' view which contains 'StatusGuid' column. It has the same disadvantage I mentioned ealrier. For a regular standard pc for which you have not set the status before it is not there :(

    Tomasz