I apologize, I thought I was using the code you provided.
I changed mine to match yours exactly. Now, I am getting a new error message. The error message is "Object doesn't support this property or method". When I click on Debug, it highlights this line of code:
I changed mine to match yours exactly. Now, I am getting a new error message. The error message is "Object doesn't support this property or method". When I click on Debug, it highlights this line of code:
Code:
.Source = "SELECT mail FROM 'LDAP://" & DomainDN & "' WHERE objectCategory='User' AND department ='" & DeptName & "'"