Symantec Management Platform (SMP) Community

 View Only
  • 1.  TaskManagementService Web Service Samples ?? How to use?

    Posted Oct 14, 2014 11:18 AM

    I've been unable to find any additional info besides that which is provided by the Web Service Description for the Symantec/Altiris TaskManagementService Web Service. I found the Web Service Description at: http://{your_NS_server}/Altiris/ASDK.Task/TaskManagementService.asmx.

     

    Has anyone found additional documentation regarding this? Samples of calling any of the operations listed here? Parameters?

     

     

    Thanks,

    Bryan



  • 2.  RE: TaskManagementService Web Service Samples ?? How to use?

    Posted Oct 17, 2014 01:59 PM

    I am wondering this as well, any input will be appreciated



  • 3.  RE: TaskManagementService Web Service Samples ?? How to use?

    Broadcom Employee
    Posted Oct 17, 2014 03:13 PM

    Greetings!

    I did a quick search of Connect on the "TaskManagementService" key words, and came up with these useful items:

    http://www.symantec.com/connect/downloads/web-page-enabling-support-deploy-tasks-or-packages-specific-machines-ns7

    http://www.symantec.com/connect/downloads/ticklr-v1

    http://www.symantec.com/connect/articles/asdk-training-writing-your-own-web-application

    Do they help you?

    Russ



  • 4.  RE: TaskManagementService Web Service Samples ?? How to use?

    Broadcom Employee
    Posted Oct 18, 2014 04:25 PM

    Hi,

    Basically, Task Management allows you to create the task specifying some existing wsdl and execute this task. Depending on wsdl you may provide custom parameters while creating the task.

    You may find sample task "Get NS Registered Services" in "Console - Manage - Jobs and Tasks - Samples - Notification Server - Get NS Registered Services".

    To create new web-service task you need to right-click to any mode on Jobs-and-Tasks page, select New -> Task, find "Call web service" or "Call web-service on server" type of task in the left tree, load existing wsdl and press OK.

    call-web-service.png

    Thank you,

    Alex.



  • 5.  RE: TaskManagementService Web Service Samples ?? How to use?

    Posted Jan 25, 2015 07:39 PM

    Cheers, just found this! Helped a treat with what I'm working on



  • 6.  RE: TaskManagementService Web Service Samples ?? How to use?

    Posted Feb 09, 2015 02:08 PM

    All the info on TaskManagementService and the others services are found it on the NS Server:

    1. folder (C:\Program Files\Altiris\Altiris ASDK):
    • Bin                        -- Contains command-line interface (CLI) executables.
    • COM Assemblies -- Contains COM assembly files.
    • Config                   -- Contains configuration files.
    • Web                      -- Contains the files for the ASDK web service virtual directory.
    • Samples               -- Contains working example scripts for many APIs and common tasks.
    • Help                      -- Contains help files documentation in CHM format.
    1.  List of other services:
    2. if you browse to the services, you get a very small info on the purpose of the function.

    Small sample I wrote using powershell to call a task in Altiris from the client:

     

    
    # check if client exist
    if (Test-Path 'C:\Program Files\Altiris\Altiris Agent\AeXNSAgent.exe' -erroraction silentlycontinue) { 
        # time in minutes
        $TaskRuntime = 0
    
        # this is just a sample task i created in Altiris, you can either supply the Task GUID or get it at run time (I am just supplying on this code)
        $TaskGUID = "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx}"
    
        # Name of the Task you create on Altiris
        $TaskName  = "Command DIR"
    
        # initializing Altiris Object
        $altirisagent  = get-wmiobject -class AltirisAgent_Client -namespace "root\CIMV2" -ErrorVariable +err -WarningAction SilentlyContinue 
    
        # get GUID info inside the brackets
        $Comp_GUID = $($altirisagent.MachineGUID | select-string -Pattern "{([A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12})}").Matches[0].Groups[1].Value
    
        # Altiris Credentials
        $username = "DOMAIN\USERNAME"
        $secureStringPassword = ConvertTo-SecureString 'USERNAMEPASSWORD' -AsPlainText –Force
    
        # create connection using the appropriated credentials
        $myCred = New-Object System.Management.Automation.PSCredential $username, $secureStringPassword
    
        # Starting Altiris Web Service
        $err=@()
        $taskManagement = New-WebServiceProxy -Uri "https://ALTIRIS_SERVER_NAME/Altiris/ASDK.Task/TaskManagementService.asmx?WSDL" -Credential $myCred -ErrorVariable +err
        if ($err.count -ge 1){ 
            Write-Host
            Write-Host " - Error: $err" 
        } else {
    
            # Execute Task
            $inputXml =	"<inputParameters>
                            <parameter>
                                <name>@AssignedResources</name>
                                <value>$Comp_GUID</value>
                            </parameter>
                            <parameter>
                                <name>@CompRequirements</name>
                                <value>
                                    <minWaitTime>1 minutes</minWaitTime>
                                    <maxWaitTime>$taskRuntime minutes</maxWaitTime>
                                    <minCompletion>95 %</minCompletion>
                                </value>
                            </parameter>
                        </inputParameters>";
    
            Write-Host " - Sending Task to Altiris Server ..."
            Start-Sleep 2
            $TaskResult = $taskManagement.ExecuteTask($taskGUID, $TaskName, $inputXml)
    
            if ($TaskResult.Guid -eq ""){
                Write-Host
                Write-Host "Error running Task ..."
            } else {
                Write-Host " - Task was successfully send it ..."
            }
        }
    } else {
        write-host 
    	write-host " - Altiris Client not found."
    }
    

     



  • 7.  RE: TaskManagementService Web Service Samples ?? How to use?

    Posted Mar 02, 2015 07:02 AM

    I have written an article as well some time ago:

    https://www-secure.symantec.com/connect/articles/using-taskmanagement-scheduletaskcustom