travelfurther
MIS
Hi,
I've got a vbs script to create an NT user and Exchange Mailbox.
Everything is working fine. e.g. the user and Mailbox are created. As
a next step, I then add the extra code to add a user to a Distribution
List. This is done from a checkbox on an asp form. It picks up the
correct checked box, binds in the the DL, but won't add it, giving
this error:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Add'
/addit55.asp, line 226
Line 226 being: "oDLObj.Add Mailbox.ADsPath"
I've done some response.writes and here is the output:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setting Distribution List Memberships
DL Member Path: LDAP://Bones/cn=Walt
Disney,cn=Recipients,ou=Cemetary,o=BoneCollectors
ADsPath is: LDAP://Bones/cn=Recipients,ou=Cemetary,o=BoneCollectors
DistList: DL_3 (OfficeStaff)
ThisDL path: LDAP://Bones/cn=OfficeStaff,cn=Recipients,ou=Cemetary,o=BoneCollectors
Bound to DistList: LDAP://Bones/cn=OfficeStaff,cn=Recipients,ou=Cemetary,o=BoneCollectors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is the relevant code in question:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Response.Write "Setting Distribution List Memberships<BR>"
ADsPath = "LDAP://Bones/cn=Recipients,ou=Cemetary,o=BoneCollectors"
Const DLCount = 4
DistListNames = Array ("Group 031", "Group 032", "Group IT",
"OfficeStaff"
ADsDLMemPath = "LDAP://Bones/cn=" & MailboxDisplayName &
",cn=Recipients,ou=Cemetary,o=BoneCollectors"
Response.Write "DL Member Path: " & ADsDLMemPath & "<BR>"
Response.Write "ADsPath is: " & ADSpath & "<BR>"
For i = 0 to DLCount - 1
GroupFormField = "DL_" + CStr (i)
if request(GroupFormField) = "ON" then
if DistListNames(i) <> "" then
'Bind to the Distribution List in the Exchange Directory
Response.Write "DistList: " & GroupFormField & " (" &
DistListNames(i) & " <BR>"
ADsThisDLPath = "LDAP://Bones/cn=" & DistListNames(i) &
",cn=Recipients,ou=Cemetary,o=BoneCollectors"
Response.Write "ThisDL path: " & ADsThisDLPath & "<BR>"
Set oDLObj = GetObject (ADsThisDLPath)
if Err.Number <> 0 then
Response.Write "Could not bind to DistList: " &
ADsThisDLPath & "<BR>"
Err.Clear
else
Response.Write "Bound to DistList: " & oDLObj.ADsPath &
"<BR>"
end if
'*************Here is the problem area ??****************
oDLObj.Add Mailbox.ADsPath
'oDLObj.Add Mailbox
'oDLObj.Add (ADsDLMemPath)
'oDLObj.Add ADsDLMemPath
'oDLObj.SetInfo
'******Ive tried all the above methods remmed out*******
if Err.Number <> 0 then
ErrorMessage = "Could not add User to DistList: Error #" &
CStr(Err.Number) & _
"-" & Err.Description & "<BR>"
Response.Write (ErrorMessage)
Err.Clear
else
Response.Write "User added to DistList. <BR>"
end if
end if
end if
Next
===================
Any ideas??
TIA
Ina
I've got a vbs script to create an NT user and Exchange Mailbox.
Everything is working fine. e.g. the user and Mailbox are created. As
a next step, I then add the extra code to add a user to a Distribution
List. This is done from a checkbox on an asp form. It picks up the
correct checked box, binds in the the DL, but won't add it, giving
this error:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Add'
/addit55.asp, line 226
Line 226 being: "oDLObj.Add Mailbox.ADsPath"
I've done some response.writes and here is the output:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setting Distribution List Memberships
DL Member Path: LDAP://Bones/cn=Walt
Disney,cn=Recipients,ou=Cemetary,o=BoneCollectors
ADsPath is: LDAP://Bones/cn=Recipients,ou=Cemetary,o=BoneCollectors
DistList: DL_3 (OfficeStaff)
ThisDL path: LDAP://Bones/cn=OfficeStaff,cn=Recipients,ou=Cemetary,o=BoneCollectors
Bound to DistList: LDAP://Bones/cn=OfficeStaff,cn=Recipients,ou=Cemetary,o=BoneCollectors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is the relevant code in question:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Response.Write "Setting Distribution List Memberships<BR>"
ADsPath = "LDAP://Bones/cn=Recipients,ou=Cemetary,o=BoneCollectors"
Const DLCount = 4
DistListNames = Array ("Group 031", "Group 032", "Group IT",
"OfficeStaff"
ADsDLMemPath = "LDAP://Bones/cn=" & MailboxDisplayName &
",cn=Recipients,ou=Cemetary,o=BoneCollectors"
Response.Write "DL Member Path: " & ADsDLMemPath & "<BR>"
Response.Write "ADsPath is: " & ADSpath & "<BR>"
For i = 0 to DLCount - 1
GroupFormField = "DL_" + CStr (i)
if request(GroupFormField) = "ON" then
if DistListNames(i) <> "" then
'Bind to the Distribution List in the Exchange Directory
Response.Write "DistList: " & GroupFormField & " (" &
DistListNames(i) & " <BR>"
ADsThisDLPath = "LDAP://Bones/cn=" & DistListNames(i) &
",cn=Recipients,ou=Cemetary,o=BoneCollectors"
Response.Write "ThisDL path: " & ADsThisDLPath & "<BR>"
Set oDLObj = GetObject (ADsThisDLPath)
if Err.Number <> 0 then
Response.Write "Could not bind to DistList: " &
ADsThisDLPath & "<BR>"
Err.Clear
else
Response.Write "Bound to DistList: " & oDLObj.ADsPath &
"<BR>"
end if
'*************Here is the problem area ??****************
oDLObj.Add Mailbox.ADsPath
'oDLObj.Add Mailbox
'oDLObj.Add (ADsDLMemPath)
'oDLObj.Add ADsDLMemPath
'oDLObj.SetInfo
'******Ive tried all the above methods remmed out*******
if Err.Number <> 0 then
ErrorMessage = "Could not add User to DistList: Error #" &
CStr(Err.Number) & _
"-" & Err.Description & "<BR>"
Response.Write (ErrorMessage)
Err.Clear
else
Response.Write "User added to DistList. <BR>"
end if
end if
end if
Next
===================
Any ideas??
TIA
Ina