How to populate a collection from list of computers

I need to create three ‘computer groups’ and populate them manually. Is there a way to do this by importing a list of computers?

I think I wrote a Dashboard for that once, but don’t have it handy right now.

One “console trick” way to do it is to take an empty Action and paste your computer name list into the “Enter computer name” dialog. Then, you can check the “Reported Computers” tab of the action, select all the computers, right-click and “Add to manual group”.

This old thread may help you customize a wizard to do that for you.

Give this a try (save it as .ojo) and import as a file to a custom site. It doesn’t look pretty (never spent the time for that) but it should work

<?xml version="1.0"?>
<BES>
  <Wizard>
    <Title>Computer List</Title>
   <UIHooks Menu="Wi&amp;zards" NavBar="Wizards" LaunchType="Document"></UIHooks>
    <DefaultPage>Page1</DefaultPage>
    <Page Name="Page1">
      <Title>MGTI Computer List</Title>
      <HTML>
        <![CDATA[<FORM>
					
					<table>
						<tr>
							<td>
								Paste the list of values below:
								<br/>
								<textarea id="hostnames" rows=30 cols=50 ></textarea>
							</td>
							<td id="errorTD"  style="display: none">
								Not Found:
								<br/>
								<textarea rows=30 cols=50 id="errorField"></textarea>
							</td>
						</tr>
					</table>
					<br />
					<center><SELECT id="property" name="property" onchange="document.getElementById('errorTD').style.display = 'none';"> <OPTION value="name" selected>Search by Hostname</OPTION> <OPTION value="ipaddress">Search by IP Address</OPTION></SELECT>&nbsp;<SELECT id="pattern" name="pattern" onchange="warning();"> <OPTION value="=" selected>Using EXACT Values</OPTION> <OPTION value="contains">Using Wildcard Search</OPTION></SELECT>&nbsp;<button onclick="openGroup()">View Computer Search</button><br /><br />
					<b>Note:</b> Use the "back" button to see error list (computers not found in the console)<br />
					<p style="display: none;" id="hideShow"><font style="color: #FF0000;"><b>Warning: </b></font>Search will produce all servers matching supplied strings within the corresponding property. Please verify the accuracy of the list before taking actions against the list.</p>
					</center></FORM><script type="text/javascript">
					function openGroup()
					{
						var names = document.forms[0].hostnames.value.split('\n');
						var ids = new Array();
						var errs = new Array();
						document.forms[0].errorField.value = '';
						document.getElementById('errorTD').style.display = 'none';
							
						for (var i = 0; i< names.length; i++)
						{
							if (document.forms[0].property.options[document.forms[0].property.selectedIndex].value == "name"){
								var rel = 'ids of bes computers whose (name of it as lowercase ' + document.forms[0].pattern.options[document.forms[0].pattern.selectedIndex].value + ' "'+ chomp(names[i].toLowerCase()) + '")';
							} else if (document.forms[0].property.options[document.forms[0].property.selectedIndex].value == "ipaddress"){
								var rel = 'ids of bes computers whose (exists (ip addresses of it) whose (it as string ' + document.forms[0].pattern.options[document.forms[0].pattern.selectedIndex].value + ' "'+ chomp(names[i].toLowerCase()) + '"))';
	
							}							
							var id = EvaluateRelevance(rel);
							if (id && id.length == 1)
							{
								ids.push(id);
							}
							else if (id && id.length > 1)
							{
								ids = ids.concat(id);
							}
							else
							{
								errs.push(chomp(names[i].toLowerCase()));
							}
						}
						if (errs.length > 0)
						{
							document.forms[0].errorField.value = errs.join('\n');
							document.getElementById('errorTD').style.display = '';
						}
						OpenComputerGroup(ids);
					}
					
					function chomp(raw_text)
					{
						return raw_text.replace(/(\n|\r)+$/, '');
					}

					function warning()
					{
						if (document.forms[0].pattern.options[document.forms[0].pattern.selectedIndex].value == "="){
							document.getElementById('hideShow').style.display = 'none';
							reset();
						} else if (document.forms[0].pattern.options[document.forms[0].pattern.selectedIndex].value == "contains"){
							document.getElementById('hideShow').style.display = 'block';
							reset();
						}
					}
					function reset()
					{
						document.getElementById('errorTD').style.display = 'none';
					}
					</script>					
				]]>	     
			</HTML>
    </Page>
  </Wizard>
</BES>`