Ivanti Deployment Agent – Change Deployment Group

Moves a computer to a new deployment group using the ccacmd.exe utility on the endpoint. _x000A__x000A_Note 1: The Allow unregistration option MUST be enabled in the original deployment group._x000A_Note 2: The Allow self-registration option MUST be enabled in the target deployment group._x000A__x000A_This script requires Management Center 8.6 or higher._x000A_See https://community.ivanti.com/docs/DOC-68222 for additional details.

Version: 1.0.15
Created: 2018-06-12T19:19:44.893
Modified: 2018-06-13T03:15:03.207
Creator: Landon Winburn
Downloads: 33
Tags:
The Script Copy Script Copied to clipboard

$DeploymentGroup = $args[1]
$URL = $args[0]

If ((Test-Path “C:Program FilesAppSenseManagement CenterCommunications AgentCcaCmd.exe”) -eq $false){
“CCA not found”
exit(1)
}

“Unregistering the computer from the Management Server”
$output = & ‘C:Program FilesAppSenseManagement CenterCommunications Agentccacmd.exe’ /unregister

If (-not ($output -eq “The operation succeeded.”)){
“Error unregistering the computer from the Management Server”
exit(1)
}

“Deleting the Communications Agent key”
Try{
remove-item -path ‘HKLM:SOFTWAREAppSense TechnologiesCommunications Agent’ -Recurse -Force}
Catch{
“Error removing the Coummications Agent key”
exit(1)
}

“Starting the CCA”
Try{
start-service -name ‘AppSense Client Communications Agent’}
Catch{
“Error starting the CCA”
exit(1)
}

“Joining the $DeploymentGroup deployment group”
$output = & ‘C:Program FilesAppSenseManagement CenterCommunications Agentccacmd.exe’ /URL $URL $DeploymentGroup

If (-not ($output -eq “The operation succeeded.”)){
“Error unregistering the computer from the Management Server”
exit(1)
}

“Restarting the CCA”
Try{
Stop-Service -name ‘AppSense Client Communications Agent’ -Force
Start-Service -name ‘AppSense Client Communications Agent’}
Catch{
“Error Restarting the service.”
}

“Done”

START YOUR TRIAL

Get Your Download Link

Gain access to ControlUp from your PC. Register and get a link to start your Free Trial.