You already gave the answer yourself. Check if the group exists.
Code:

$group = getobject("WinNT://$target/$group")
if vartype($group) <> 9
; create group
endif


Just fill in $target and $group as appropriate.
_________________________
There are two types of vessels, submarines and targets.