I am having issues with adding Host Machines to existing Host Group using the code below. I want to be able to remove the machines that exist in the group and add new machines from spreadsheet, every time the script runs.
Please help if you can...
Set TSHostGroupFactory = TDCon.HostGroupFactory
Set TSHostGroup = TSHostGroupFactory.AddItem("execution")
Set thisGroup = TSHostGroupFactory.Item("execution")
Set TSAddHost = thisGroup.AddHost("DevMachine1") - this line does not seem to work...
It is probably the previous line that is not working. You might need a post after creating the group but you shouldn't need the second last line anyway as you already have the group in the variable TSHostGroup. Also, you need to pass an id to item, not a name.