Skip to main content

Offline Agents - Auto-Retire - Manual Execution

Summary

The purpose of this script is to retire the client agents that are offline in Automate for more than the days defined in the Threshold and are not Broken agents.

Sample Run

For the initial execution:

Set the Set_Environment value to 1 and set the Set_Global_Threshold_Days value as per the client's requirement, suppose it's '180' days.

Sample Run Image 1

Leave all parameters blank to retire just workstations.

Sample Run Image 2

Set the Server value to 1 to retire both workstations and servers.

Sample Run Image 3

Note: Since this is a client script, it must be executed on the client.

User Parameters

NameExampleRequiredDescription
Set_Environment1Mandatory for the first runFor the script's initial execution, this parameter must be used. The dependent EDFs and the system property are essential for the script to function properly. These required EDFs and System Property are created when the script is executed with this parameter set to 1.
Set_Global_Threshold_Days180FalseThe global property 'AutoRetireThreshold_Days' is set when the value in 'Set_Global_Threshold_Days' is specified. If left empty, the global property will be set to '90'.
Server1FalseSet its value to 1 if the client wants to retire servers along with workstations.
  • 1 - Set its value to 1 to remove servers along with workstations
  • 0 - Set its value to 0 to retire workstations only.

System Properties

NameExampleRequiredDescription
AutoRetireThreshold_Days180TrueThreshold days to retire the offline computers. The default is 90. It can either be set during the first execution of the script or manually from the dashboard.

System Properties Image

Extra Data Fields

NameLevelSectionTypeRequiredDescription
Exclude From Auto-Retire AutomationClientExclusionsCheck boxFalseThe script will not generate any tickets for the client if this EDF is checked.
Exclude From Auto-Retire AutomationLocationExclusionsCheck boxFalseThe script will not include any computer from the location in the ticket if this EDF is checked.
Exclude From Auto-Retire AutomationComputerExclusionsCheck boxFalseThe script will not include the computer in the ticket if this EDF is checked.
AutoRetire Threshold DaysClientDefaultTextBoxFalseTo overwrite the threshold set in the Global Property AutoRetireThreshold_Days for the client.
AutoRetire Threshold DaysLocationDefaultTextBoxFalseTo overwrite the threshold set in the Global Property AutoRetireThreshold_Days and Client-Level EDF AutoRetire Threshold Days for the location.

The following EDFs can be used to overwrite the Threshold Days defined in the System property AutoRetireThreshold_Days:

Client-Level EDF: "AutoRetire Threshold Days"

Client-Level EDF

Location-Level EDF: "AutoRetireThreshold_Days"

Location-Level EDF

The following EDFs can be used to exclude a client/location/computer from retirement:

Client-Level EDF: "Exclude From Auto-Retire Automation"

Client-Level EDF Exclusion

Location-Level EDF: "Exclude From Auto-Retire Automation"

Location-Level EDF Exclusion

Computer-Level EDF: "Exclude From Auto-Retire Automation"

Computer-Level EDF Exclusion

Implementation

  1. Import the script using the ProSync Plugin.
  2. Reload the System Cache.

Reload System Cache

  1. Configure the script as follows:
    • Navigate to Automation --> Scripts within the CWA Control Center and open the script.
    • Debug the script against any client with the Set_Environment parameter set to 1 and Set_Global_Threshold_Days set to the number of days for the global property AutoRetireThreshold_Days.
      • Validate that the system property was set correctly by navigating to System --> Configuration --> Dashboard --> Config --> Configurations --> Properties --> Check the property 'AutoRetireThreshold_Days'.
    • Run the script against the desired client.