Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying LDAP properties of object ? 1

Status
Not open for further replies.

cruford

Programmer
Dec 6, 2002
138
US
I have this small piece of code to connect to an exchange 5.5 server through LDAP:

Code:
Dim strMailBoxPath, strMailServer
Dim strNewDisplayName, objRecip, objMember
strMailServer = "server"
strMailBoxPath = "o=myO/ou=myOU/cn=Recipients"
Set objRecip = GetObject("LDAP://" & strMailServer & "/" & strMailBoxPath)
For Each objMember In objRecip
	WScript.Echo "Name: " & objMember.Name
Next

The .name property returns a value like "cn=userid". How can I tell what properties I can view and/or edit besides the .name? What I'm trying to accomplish is to change the display name (LDAP: cn) and hide from address book (LDAP: Hide-From-Address-Book) properties for disabling Exchange 5.5 email accounts. Am I going about this wrong or can someone point me to some examples?

We are running Exchange 5.5 on a NT4.0 domain.
 
cruford,

Try this.
[tt]
for each objMember in objRecip
set oschema=getobject(objMember.schema)
info="mandatory: " & vbcrlf
for each sattrib in oschema.mandatoryproperties
info=info & sattrib & vbcrlf
next
info=info & "optional: " & vbcrlf
for each sattrib in oschema.optionalproperties
info=info & sattrib & vbcrlf
next
wscript.echo objMember.name & "Properties" & vbcrlf & info
next
[/tt]
Be mindful if you want to see each and every member's---that is tedious.

regards - tsuji
 
Thank you tsuji that is what I needed. No I don't want every user, I am just using this to disable users when they leave so I will be looking into limiting this by user id or something similar. I just needed a way to see what properties I could manipulate.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top