Skip to content

A PowerShell module that for Symantec's Altiris ASDK uses web service calls

License

Notifications You must be signed in to change notification settings

rsteenwyk/PowerShellSymantecAltirisASDK

 
 

Repository files navigation

What is this?

The Administrator Software Development Kit (ASDK) is a set of application programming interfaces (APIs) that access the functionality of Notification Server (NS), Site Servers (previously called Task Servers), and various NS solutions.

What I have built here is a PowerShell module that maps out the various web services provided by the ASDK for the following purposes:

  • Ease of learning
  • Quick prototyping
  • Ease of scripting
  • Community improvement of ASDK documentation and examples

​I am not sure if it is just me or everyone who experiences frustration with the lack of good examples provided in the current ASDK help files and the frustration of needing to have the help file open and cross referencing it while attempting to code up a solution.

The PowerShell module takes the ASDK documentation and merges it with the web services available making it easy to learn and easy to find the services and API you are looking for.

 

Getting Started

 

Installation

Open PowerShell and run the following:

(new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/Tiberriver256/PowerShellSymantecAltirisASDK/master/GetPowerShellSymantecAltirisASDK.ps1") | iex

 

 

Listing available commands

There are currently 228 cmdlets available in the module they can be viewed using the following command:

Get-Command -Module PowerShellSymantecAltirisASDK

 

Finding commands specific to what you are trying to do, say work with package commandlines, is as simple as the following:

PS C:\> Get-Command *commandline* -Module PowerShellSymantecAltirisASDK

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        AddCommandLineToSoftwareComponent                  0.0        PowerShellSymantecAltirisASDK
Function        CreateCommandLine                                  0.0        PowerShellSymantecAltirisASDK
Function        DeleteCommandLine                                  0.0        PowerShellSymantecAltirisASDK
Function        GetCommandLine                                     0.0        PowerShellSymantecAltirisASDK
Function        RemoveCommandLineFromSoftwareComponent             0.0        PowerShellSymantecAltirisASDK
Function        SetCommandLineProperty                             0.0        PowerShellSymantecAltirisASDK

 

Getting help for specific commands

The ASDK help file for the various methods on the various web services has been integrated into PowerShell help, so standard help commands can be run to view the documentation.

PS C:\> help SetCommandLineProperty -Full

NAME
    SetCommandLineProperty

SYNOPSIS
    Set software command line property.

SYNTAX
    SetCommandLineProperty [-CommandLineGuid] <Guid> [-PropertyName] <String> [-PropertyValue] <String> [-Server]
    <String> [[-Credential] <PSCredential>] [<CommonParameters>]


DESCRIPTION


PARAMETERS
    -CommandLineGuid <Guid>
        GUID of software command line

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -PropertyName <String>
        name of property. Valid properties are: Name, Description, CommandLine, CommandLineType, IsDefault,
        SuccessCodes, FailureCodes, PackageGuid

        Required?                    true
        Position?                    2
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -PropertyValue <String>
        The property value is passed into the method as a string, appropriate conversion will then be performed on
        that string. The value CommandLineType should be a Guid, IsDefault is a bool value so it should be "true" or
        "false", and PackageGuid should be a Guid.

        Required?                    true
        Position?                    3
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Server <String>

        Required?                    true
        Position?                    4
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    -Credential <PSCredential>

        Required?                    false
        Position?                    5
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

OUTPUTS

    -------------------------- EXAMPLE 1 --------------------------

    PS C:\>set failure codes for command line


    CopyC#
    SoftwareCommandLineManagementLib managementLib = new SoftwareCommandLineManagementLib();
    bool bResult = managementLib.SetCommandLineProperty(cmdLineGuid, "FailureCodes", "1,2,3,4,5");
    CopyVBScript
    set managementLib = CreateObject("Altiris.ASDK.SMF.SoftwareComponentManagement")
    bResult = managementLib.SetCommandLineProperty(cmdLineGuid, "FailureCodes", "1,2,3,4,5")
    CopyA
    set SMF=AltirisASDKSMF.exe
    set CMDLINE_GUID={A7B8BACC-D63B-466e-ABF6-2DC763CEBB6B}
    %SMF% cmd:SetCommandLineProperty "CommandLineGuid:%CMDLINE_GUID%" "PropertyName:FailureCodes"
    "PropertyValue:1,2,3,4,5"
    echo Failure Codes changed
    Remarks
    The CLI is being deprecated. Please see the CLI Programming Guide.






RELATED LINKS

 

 

Contributions

Contributions are welcome! I would love for any of you to submit a pull request to the main branch in Github.

 

 

Suggestions / Bugs

If you have any suggestions or bugs with the program please submit them as issues here:

https://github.com/Tiberriver256/PowerShellSymantecAltirisASDK/issues

About

A PowerShell module that for Symantec's Altiris ASDK uses web service calls

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%