afranka
12-13-2005, 12:24 PM
Hi,
I have a vbscript which when run on a pc accesses and displays (in an annoying popup kind of way) a list of Outlook (exchange) distribution lists and their owners. I'd really like to list these on a basic web page.
The original vb code which works is below. I changed the wscript.echo statements to response.write but am not getting any joy. Am I missing something really silly?
I'd appreciate any suggestions you could offer.
Thanks!
a.
On Error Resume Next
Const ADS_SCOPE_SUBTREE = 2
OU = "'LDAP://DC=test,DC=com'"
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select distinguishedName, displayName, msExchALObjectVersion from " & OU & " where objectClass='group' order by displayName"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 360
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
'wscript.echo objRecordSet.Fields("Name").Value
if objRecordSet.Fields("msExchALObjectVersion").Value <> "" then
wscript.echo
wscript.echo objRecordSet.Fields("displayName").Value
goManagedBy
end if
objRecordSet.MoveNext
Loop
Set objCOmmand.ActiveConnection = nothing
Set objRecordSet = nothing
Set objCommand = nothing
Set objConnection = nothing
Sub goManagedBy
Set objGroup = GetObject _
("LDAP://" & objRecordSet.Fields("distinguishedName").Value)
strManagedby = objGroup.Get("managedBy")
wscript.echo Mid(strManagedby,4,Instr(strManagedby, ",")-4)
'wscript.echo strManagedBy
End Sub
I have a vbscript which when run on a pc accesses and displays (in an annoying popup kind of way) a list of Outlook (exchange) distribution lists and their owners. I'd really like to list these on a basic web page.
The original vb code which works is below. I changed the wscript.echo statements to response.write but am not getting any joy. Am I missing something really silly?
I'd appreciate any suggestions you could offer.
Thanks!
a.
On Error Resume Next
Const ADS_SCOPE_SUBTREE = 2
OU = "'LDAP://DC=test,DC=com'"
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select distinguishedName, displayName, msExchALObjectVersion from " & OU & " where objectClass='group' order by displayName"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 360
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
'wscript.echo objRecordSet.Fields("Name").Value
if objRecordSet.Fields("msExchALObjectVersion").Value <> "" then
wscript.echo
wscript.echo objRecordSet.Fields("displayName").Value
goManagedBy
end if
objRecordSet.MoveNext
Loop
Set objCOmmand.ActiveConnection = nothing
Set objRecordSet = nothing
Set objCommand = nothing
Set objConnection = nothing
Sub goManagedBy
Set objGroup = GetObject _
("LDAP://" & objRecordSet.Fields("distinguishedName").Value)
strManagedby = objGroup.Get("managedBy")
wscript.echo Mid(strManagedby,4,Instr(strManagedby, ",")-4)
'wscript.echo strManagedBy
End Sub