Hi all,
Having "borrowed" this script and modified, it works fine by itself.
I want to use this as part of a loop to create groups and populate
from a file with format group|user
' SimpleGroup.vbs
' Sample VBScript to create a Global Security Group
' Author Guy Thomas http://computerperformance.co.uk/
' Version 2.4 - May 2005
' ----------------------------------------------------------'
Dim strOU, strGroup, strDNSDomain
Dim objOU, objGroup, objUser
' Check - Make sure you have the OU referenced by strOU
strOU = "OU=Newport,"
strNewGp = "Coal Porters1"
strNewGpLong = "CN=" & strNewGp
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
' Create new Group
Set objOU = GetObject("LDAP://" & strOU & strDNSDomain )
Set objGroup = objOU.Create("Group",strNewGpLong)
objGroup.Put "sAMAccountName", strNewGp
objGroup.setInfo
Wscript.Quit
' End of Simple Group VBScript.
So if I have a group that already exists, it dies. How can I check
for the existence of a group before objGroup.setInfo?