How can I automatically create groups in Deployment Solution and filter computers into those groups based on a naming convention?
Last Updated April 06, 2007
Question How can I automatically create groups in Deployment Solution and filter computers into those groups based on a naming convention?
This article assumes you have the Deployment Solution portion of the ASDK installed on your Deployment Server. This can be obtained from the Altiris Web site.
The attached VBS script and .ini file are an example of how to create and filter groups using the ASDK. It will create groups in your Deployment Server console and filter machines into them according to the information you supply in the ini file. The format of the .ini file is as follows:
Group Name 1 Filter condition for Group Name 1 Group Name 2 Filter condition for Group Name 2 Group Name 3 Filter condition for Group Name 3 And so on...
The Filter Condition uses % as a wildcard.
For example, to create a group called "Test Computers", which should contain all computers that have a name starting with 'TEST' you would type the following in the ini file:
Test Computers TEST%
To additionally create a group called "Citrix Servers" that contains all computers with a name that contains "CITRIX" you would add:
Citrix Server %CITRIX%
The script has been created to ignore all computers contained within a group that starts with a pound/hash sign (#) character. This is so that you can segregate computers into test, temporary, and troubleshooting groups and not have them filter into their respective categories.
For example, to create a test group, simply create a new group named "#Test Group". This functionality can easily be adjusted within the script to ignore other types of characters.
Please note the following:
The Filter Condition is not case sensitive.
The script must be run on the Deployment Server.
All computers will be filtered each time the script is run unless they are contained within a group that starts with a pound/hash sign (#).
Ensure that the formatting of the .ini file stays consistent and lists Group Name and Filter Condition on alternate lines.
Ensure that the .ini file is located within the same folder as the script file.
The script does not contain any error handling, this should be added if required.
This script is a very simple example and can be freely customized as required.
Warning: This script is to be used entirely at your own risk. It is thoroughly recommended that full testing be completed within a suitable test infrastructure.