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 ?
errorReturn = assetManagement.SetAssetStatus(strGuid, "Active")
If errorReturn Then
wscript.echo "Successfully set asset status on " & strName
wscript.echo "Not set asset status on " & strName
set assetManagement = Nothing
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
Asset management does not seem to exist at all on 7.x :(
Any ideas ?
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.
There are also the 'Get Status For Asset By Id Component' and 'Set Status For Asset Component' which you could use.
If you want to see a Computer's Status:
Go to the Resource:
Settings | Notification Server | Resource and Data Class Settings | Resource Types | Asset Types | IT | Computer
The Asset's Status is a Resource Association.
Settings | Notification Server | Resource and Data Class Settings | Resource Associations | 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, *
WHERE [Name] LIKE '%Fixed Asset Status%'
From here look in: vRM_Fixed_Asset_Status_Resource_Type_Item to get your list of Statuses.
You can then use the ResourceAssociation Table to see each Computer's Status:
RM_ResourceComputer.Name AS [ComputerName],
vRM_Fixed_Asset_Status_Resource_Type_Item.Name AS [Status]
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
(ResourceAssociation.ResourceAssociationTypeGuid = '3028166f-c0d6-41d8-9cb7-f64852e0fd01')
do you want to just set the asset status in the asset tables ? I have done this through a sql script that is scheduled
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
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 :(