Altiris Software Dev Kit (ASDK)

 View Only
Expand all | Collapse all

Altris web service calls example

  • 1.  Altris web service calls example

    Posted Jul 06, 2015 12:55 PM

    Hi ,

    I want to insert record into altris using web service.  we are using altris 7.5.1 version.

     

    Thanks,

    Amar



  • 2.  RE: Altris web service calls example

    Posted Jul 08, 2015 07:11 AM

    Hi

    It depends on what you want to insert.

    Regards
    Stephan



  • 3.  RE: Altris web service calls example

    Posted Jul 14, 2015 03:32 AM

    Have you checked the ASDK Help file, as that contains explanations, examples and also example files?



  • 4.  RE: Altris web service calls example

    Posted Jul 15, 2015 10:59 AM

    Please post the example from the ASDK that creates an item or record.



  • 5.  RE: Altris web service calls example

    Posted Jul 16, 2015 01:50 AM

    An item is anything you see in the Symantec Management Console.  Below is a C# example of how to create a folder item: 

     

    // See ItemManagementLib Overview for an example of setting up m_proxy.
    Guid myCollectionFolderGuid = new Guid("{7070fb1c-cf5c-49f9-8764-593124e78c1d}");
    ItemDetails folderObject = m_proxy.CreateFolder("NewfolderName", myCollectionFolderGuid );

     

     

    Please refer to the C# Web Service Programming Guide section of the ASDK's Help file, which you can access from the SMP's OS start menu. 

     

    SK



  • 6.  RE: Altris web service calls example

    Posted Jul 17, 2015 08:10 AM

    Thanks!  Is there an example of creating a resource like a computer?



  • 7.  RE: Altris web service calls example

    Posted Jul 17, 2015 08:36 AM

    Not that I can see, and I don't think that there is an Asset Management ASDK which is a pity; however, there is already multiple methods available to create computer resources by importing them either via the AD Connector, Data Connector, etc. 



  • 8.  RE: Altris web service calls example

    Posted Jul 17, 2015 10:05 AM

    This code (powershell), creates a predefined computer (with a random mac)
     

    $Cred = Get-Credential
    $DSMs = New-WebServiceProxy -Uri "http://172.16.0.3/Altiris/ASDK.DeploymentSolution/DSTaskManagementService.asmx" -Credential $Cred
    $ComputerName = "WS01"
    $Mac = ('{0:X2}' -f $(Get-Random -Minimum 0 -Maximum 255) + "-" + '{0:X2}' -f $(Get-Random -Minimum 0 -Maximum 255) + "-" + '{0:X2}' -f $(Get-Random -Minimum 0 -Maximum 255)  + "-" + '{0:X2}' -f $(Get-Random -Minimum 0 -Maximum 255) + "-" + '{0:X2}' -f $(Get-Random -Minimum 0 -Maximum 255) + "-" + '{0:X2}' -f $(Get-Random -Minimum 0 -Maximum 255))
    $InputXML = "<DeploymentItem><ItemType>Resources</ItemType><ItemName>PredefinedComputers</ItemName><ItemAction>add</ItemAction><Item><Computers><Computer>$ComputerName,$Mac,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,</Computer></Computers></Item></DeploymentItem>"    
    $DSMs.RunDeploymentSolutionTask($InputXML)

     



  • 9.  RE: Altris web service calls example

    Posted Jul 17, 2015 10:47 AM

    Thanks! 

    I was definetly looking from something a bit more elegant like the CreateFolder Function.

    In the past I've used a similar solution to yours for creating other items.  I've cloned items exported the XML; changed the XML and reimported it.  Just looking for something a bit more elegant.



  • 10.  RE: Altris web service calls example

    Posted Jul 17, 2015 12:30 PM

    That's simply because a predefined computer can have that many different properties.
    For other items, more simple functions exist.



  • 11.  RE: Altris web service calls example

    Posted Jul 19, 2015 03:39 AM

    That's why utilisng data connector to import from either a database, spreadsheet or other source is great, as it allows you to select which source data should be associated with a specific computer resource table column. 

     

    Another method could be to perform the CreateComputerResource.aspx call directly. 



  • 12.  RE: Altris web service calls example

    Posted Sep 23, 2015 12:17 AM

    hiiiii.....

    thanks for the information...