Hello All,

Im try to create a list of members attached to a certain distribution list. Ive stumbled across a VBS script but cant get it to work, I wonder if anyone can see where I am going wrong?

Dim objDistList, objExcel, ExcelRow, strUser, strDistListName, strOU

strDistListName = InputBox("Enter the name of the Distribution List" _
& " who's members you wish to export.", "Distribution List Export")

If len(trim(strDistListName)) = 0 Then
End If

Set objDistList = GetObject("LDAP://cn=" & strDistListName _
& ",ou=Distribution Lists,dc=hwood,dc=local")

Set objExcel = CreateObject("Excel.Application")
With objExcel
.SheetsInNewWorkbook = 1
.Visible = True
.Worksheets.Item(1).Name = mid(objDistList.Name, _
instr(1,objDistList.Name,"=") + 1 )

For Each strUser in objDistList.Member
Set objUser = GetObject("LDAP://" & strUser)
.Cells(ExcelRow,1) = objUser.CN
.Cells(ExcelRow,2) = objUser.mail
ExcelRow=ExcelRow + 1



End With

Set objExcel = Nothing
Set objDistList = Nothing
The responce I get is:

Windows Script Host
Script: C:\Documents and Settings\hadmin\Desktop\exporter.vbs
Line: 10
Char: 1
Error: There is no such object on the server.
Code: 80072030
Source: (null)

I hope someone can help?