GROUP LABEL EDIT
From TDiWiki
This script is designed to modify a specific field for every Console in a Group. Currently the script will edit the User Defined Field 1, but can be modified to edit many other fields within the Console definition. The script also changes the label of the User Defined Field to "OS."
[edit] Script Properties
Name: GROUP_LABEL_EDIT
Description: This script will edit consoles contained in a group.
Profile: CONSOLE_MANAGER
Timeout: 30 (seconds)
[edit] Run Type
Run on Groups
[edit] Script Text
// * Copyright 1999-2011 TDi Technologies, Inc. All rights reserved. *
// * The information in this software is subject to change without *
// * notice and should not be construed as a commitment by TDi. *
// * Created: 3/31/2011 *
if (action.type != "Group") {
log("CONWRKS", "This script is intended to be run only on groups!"); // this script is intended to be run only on groups
} else {
var groupName;
var myGroup;
var groupCons;
var config;
groupName = action[action.type]; // get the name of the group the script was run on
myGroup =Group.get(groupName);
log("CONWRKS", "Script run from the " + groupName + " group.");
config = ServerConfig.get("meta");
config.udftxt_cons1 = "OS";
config.save();
// get the consoles that are a part of the group
groupCons = myGroup.getConsoles();
for (console in groupCons)
{
log("CONWRKS", "Edit the console: " + groupCons[console].name);
groupCons[console].udf1 = "TDi Linux Machine"; // set the field User Defined Field 1
groupCons[console].save();
}
}
