O
Ollie
Ok, I'm new to ADSI and am trying use the following code but get the above
error.
The error occurs on the last line...
Dim oRootDSE, oCon, oCmd, oRecordSet
Dim sDomainADsPath, sUser, sPassword, sGroup, sProperties
Dim aDescription, aMember, iCount
Set oRootDSE = GetObject("LDAP://RootDSE")
sDomainADsPath = "LDAP://" & oRootDSE.Get("defaultNamingContext")
Set oRootDSE = Nothing
Response.Write sDomainADsPath
Set oCon = Server.CreateObject("ADODB.Connection")
sUser = ""
sPassword = ""
oCon.Provider = "ADsDSOObject"
oCon.Open "ADProvider", sUser, sPassword
Set oCmd = Server.CreateObject("ADODB.Command")
Set oCmd.ActiveConnection = oCon
sProperties = "name,ADsPath,description,member"
sGroup = "*"
oCmd.CommandText = "<" & sDomainADsPath & ">;(&(objectCategory=group)(name="
& sGroup & "));" & sProperties & ";subtree"
oCmd.Properties("Page Size") = 100
Set oRecordSet = oCmd.Execute
error.
The error occurs on the last line...
Dim oRootDSE, oCon, oCmd, oRecordSet
Dim sDomainADsPath, sUser, sPassword, sGroup, sProperties
Dim aDescription, aMember, iCount
Set oRootDSE = GetObject("LDAP://RootDSE")
sDomainADsPath = "LDAP://" & oRootDSE.Get("defaultNamingContext")
Set oRootDSE = Nothing
Response.Write sDomainADsPath
Set oCon = Server.CreateObject("ADODB.Connection")
sUser = ""
sPassword = ""
oCon.Provider = "ADsDSOObject"
oCon.Open "ADProvider", sUser, sPassword
Set oCmd = Server.CreateObject("ADODB.Command")
Set oCmd.ActiveConnection = oCon
sProperties = "name,ADsPath,description,member"
sGroup = "*"
oCmd.CommandText = "<" & sDomainADsPath & ">;(&(objectCategory=group)(name="
& sGroup & "));" & sProperties & ";subtree"
oCmd.Properties("Page Size") = 100
Set oRecordSet = oCmd.Execute