extract user info from exchange 5.5
is there a tool that can extracts user info such as Title, department, tele number, etc from Exchange5.5?
eager for your anwser.
Web Development
is there a tool that can extracts user info such as Title, department, tele number, etc from Exchange5.5?
eager for your anwser.
by rrv
Hi., If you know VB6, below is the code. Or try the code in Word or Excel macro[Note to include reference to MS Active Data Objects 2.7]
Dim Usr
Set Con = CreateObject("ADODB.Connection")
Con.Provider = "ADsDSOObject"
Con.Open
Set Cmd = CreateObject("ADODB.Command")
Set Cmd.ActiveConnection = Con
'Cmd.CommandText = "SELECT AdsPath, cn FROM 'LDAP://OU=Sales,DC=Microsoft,DC=com' WHERE objectClass = 'user'"
Cmd.CommandText = ";(objectClass=organizationalPerson);cn,givenName,sn;subtree"
'Cmd.Properties("searchscope") = ADS_SCOPE_ONELEVEL
Cmd.Properties("Page Size") = 99
Set Rs = Cmd.Execute
' While Not Rs.EOF
' 'Set Usr = GetObject(Rs.Fields("AdsPath").Value)
' Debug.Print Rs.Fields("cn") & " " & Rs.Fields("givenName") & " " & Rs.Fields("sn")
Set ExchgGrd.DataSource = Rs
Rs.Close
Here ExchgGrd is the MSHflexgrid control. If Excel use current sheet. In word use a table.
All the best
RV
This discussion is closed to new replies.
Sort by Trending