knet74 Posted May 29, 2007 Posted May 29, 2007 Hi there... Is there anyone how know how to delete an active directory group by using something like this: $DeleteGrp = ObjGet("WinNT://DOMAIN/" &$GroupName) $DeleteGrp.Delete ("group",$GroupName)
herewasplato Posted May 29, 2007 Posted May 29, 2007 Welcome to the forum.Do either of these help?http://www.autoitscript.com/forum/index.ph...showtopic=28404http://www.autoitscript.com/forum/index.ph...showtopic=20852 [size="1"][font="Arial"].[u].[/u][/font][/size]
PsaltyDS Posted May 29, 2007 Posted May 29, 2007 Hi there... Is there anyone how know how to delete an active directory group by using something like this: $DeleteGrp = ObjGet("WinNT://DOMAIN/" &$GroupName) $DeleteGrp.Delete ("group",$GroupName) You could try it like this, which I got from here. (Untested): $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") ; Install a custom error handler $strPath = "DC=your,DC=domain,DC=com" ; LDAP binding path. $strParent = "OU=TestParent" ; Parent OU of group $strDelete = "CN=TestGroup" ; Group to delete. ; Bind to the object. $objADAM = ObjGet("LDAP://" & $strParent & "," & $strPath) If IsObj($objADAM) Then ; Delete Group. $objADAM.Delete ("group", $strDelete) Else MsgBox(16, "Error", "$objADAM is not an object: LDAP bind failed.") EndIf ; This is my custom error handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Windescription is: " & $oMyError.windescription) Return SetError(1) ; something to check for when this function returns EndFunc ;==>MyErrFunc Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now