I need some guidance to delete some connection objects in Active Directory Sites and Services. I have code to report the objects, I just need the confirmation on the delete portion. I am guessing its something like "objConn.Delete".
Here is the code to report them out:
Here is the code to report them out:
Code:
' ------ SCRIPT CONFIGURATION ------
strServer = "<ServerName>" ' e.g. dc01
strSite = "<SiteName>" ' e.g. MySite1
' ------ END CONFIGURATION ---------
set objRootDSE = GetObject("LDAP://RootDSE")
set objNTDSCont = GetObject("LDAP://cn=NTDS Settings,cn=" & strServer & _
",cn=servers,cn=" & strSite & ",cn=sites," & _
objRootDSE.Get("configurationNamingContext") )
objNTDSCont.Filter = Array("ntdsConnection")
WScript.Echo "Connection objects for " & strSite & "\" & strServer
for each objConn in objNTDSCont
if objConn.Get("options") = 0 then
Wscript.Echo " " & objConn.Get("cn") & " (MANUAL)"
else
Wscript.Echo " " & objConn.Get("cn") & " (AUTO)"
end if
next