AppSense: Automated CCA Install and Self-Registration

Once you have your AppSense server and databases created, you can proceed with AppSense Agent installation.  In this post we’ll cover a command-line install of the Client Communications Agent and getting the device to Self-Register.

AppSense provides all their install components as MSI files (located under \Software\Products).  Here is an example of a silent install of the Client Communications Agent which is required on all servers that you wish to manage via AppSense.

msiexec.exe /qn /i "<MSI file path>\CommunicationsAgent.msi" WEB_SITE="https://<Management Server Name>" GROUP_NAME="<DeploymentGroup>"

NOTE: Above quotes are needed.

After installation, your system will join the default Unassigned Computers deployment group, it will then Self-Register to another Deployment Group if wanted.  To set this up, you must put the Deployment Group in the above command-line installation.  You must also check the following box on the Settings Section of your Deployment Group:

Deployment Group Settings

Once part of a custom Deployment Group, it will install the other AppSense agents and configurations that are part of it using your installation schedule settings.

Thanks,
Alain

Advertisements

7 thoughts on “AppSense: Automated CCA Install and Self-Registration”

  1. Hi

    To move you can go into Management Center find the relevant PC right click and select Move, then choose destination group. Normally I poll the PC once its moved to ensure changes are picked up by the device.

    Rgds

    Mike

    1. Mike – The goal is to automate this. No admin should ever have to go in and manually move a device if at all possible. Especially since we seem to be hitting some sort of AppSense performance limitation on the number of devices that can be in a single deployment group. In our case, we stage all devices at one location. We want to automate the move of a device from one deployment group to another. We have an ER in with AppSense as this is not currently possible without additional direct SQL calls to the server… which isn’t acceptable to us.

      Ideally we would like to be able to use some sort of AppSenseClientMover.exe that accepts parameters like -Server “Server1” -GroupID “California”

      Where a device would then unregister itself from the current server it reports to, then registers against “Server1” in the deployment group called “California”

      1. You could try this script:-

        It will prompt for 3 parameters:

        The Source Deployment Group
        The Destination Deployment Group
        The name of the Management Server (simply type the hostname without http:// and /ManagementServer afterwards)

        ######################################################################################
        #
        # Usage: MS_CreateUpdateSingleMachine.ps1 MachineName GroupName
        #
        ######################################################################################
        #requires -Version 3.0

        [CmdletBinding()]
        Param(
        [Parameter(Mandatory=$true, Position=1)]
        [string]$SourceDeploymentGroupName,

        [Parameter(Mandatory=$true, Position=2)]
        [string]$DeploymentGroupName,

        [Parameter(Mandatory=$true, Position=3)]
        [string]$ManagementServerName
        )

        ######################################################################################
        # These variables can be changed
        # $dllpath = the path to the Management Console Web Services DLL
        # $url = the url of the Managemengt Server
        # $platform = the platform of the machine you want to move – 1 = 32-bit, 2 = 64-bit
        ######################################################################################
        $dllpath = “${env:ProgramFiles}\AppSense\Management Center\Console\ManagementConsole.WebServices.dll”
        $url = “http://$ManagementServerName/ManagementServer”
        $platform = 2

        ## Do not change anything below here ##`

        if ($PSVersionTable.PSVersion.Major -lt 3) {
        Write-Host “This script should only be run with PowerShell version 3 or above”
        Return
        }

        # Load proxy DLL
        Add-Type -Path $dllpath

        Write-Host

        # Get NetworkCredential instance (only PoSH v3.0 and up can use message)
        $credential = Get-Credential -Message “Enter the credentials for connecting to the Management Server”
        if (-not $credential) {
        Write-Host “No credentials were entered” -ForegroundColor Red
        Return
        }

        # Create connection to the Management Server
        try {
        [ManagementConsole.WebServices]::Connect($url, $credential)
        } catch [Exception] {
        Write-Host “Unable to connect to Management Server – $_” -ForegroundColor Red
        Return
        }

        # Let’s grab the machines from the source group
        $groups = [ManagementConsole.WebServices]::Groups.GetGroups($false).Groups
        $srcgrpid = $groups | Where Name -eq $SourceDeploymentGroupName | Select -ExpandProperty GroupKey

        if ($srcgrpid) {
        $source_machines_ds = [ManagementConsole.WebServices]::Machines.GetMachines($false)
        $source_machines = $source_machines_ds.Machines | Where GroupKey -eq $srcgrpid
        if (-not $source_machines) {
        Write-Host “No machines found in source Deployment Group” -ForegroundColor Red
        Return
        }
        } else {
        Write-Host “Deployment Group $SourceDeploymentGroupName was not found” -ForegroundColor Red
        Return
        }

        $grpid = $groups | Where Name -eq $DeploymentGroupName | Select -ExpandProperty GroupKey
        if (-not $grpid) {
        Write-Host “Deployment Group $DeploymentGroupName was not found” -ForegroundColor Red
        Return
        }

        $source_machines | % { $_.GroupKey = $grpid }
        [ManagementConsole.WebServices]::Machines.ApplyMachineChanges([ref]$source_machines_ds)

        Credit to Richard Thompson for this script

  2. Hi

    To move you simply go into Management Centre select the relevant PC right click and select Move, pick the destination group. Normally at that point I then poll the device within management Centre.

  3. This is for new installs…. How would you move a PC from one group to another post install.
    For example, I want PCs to dynamically join a group associated with a geographical location. Using another tool, I will check the IP range and then change the group on demand if the device finds itself in another site.

    1. Rick,

      I believe you would have to have your deployment groups configured for those different geographic regions. I do not recall how you would move an already configured device. It may require an uninstall and reinstall.

      Thanks for reading,
      Alain

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s