149 lines
6.7 KiB
HTML
149 lines
6.7 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
|
|
<title>Active Directory Service Interfaces - Communicating to Netscape Servers</title>
|
|
</head>
|
|
|
|
<body topmargin="0" leftmargin="0">
|
|
|
|
<table border="0" height="86" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td width="77%" valign="top" height="58"><map name="FPMap2">
|
|
<area href="http://www.microsoft.com/windows2000/library/howitworks/activedirectory/adsilinks.asp" shape="rect" coords="4, 6, 248, 57"></map><img src="banner.gif"
|
|
border="0" alt="http://www.microsoft.com/windows2000/library/howitworks/activedirectory/adsilinks.asp" width="250" height="60" usemap="#FPMap2"></td>
|
|
<td width="3%" height="58"></td>
|
|
<td width="21%" height="58" valign="bottom"><p align="right"><map name="FPMap3">
|
|
<area href="http://www.microsoft.com" shape="rect" coords="7, 6, 108, 39"></map><img src="mslogo.gif"
|
|
border="0" alt="http://www.microsoft.com" width="112" height="40" usemap="#FPMap3"></td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top" align="left" height="28"><map name="FPMap0">
|
|
<area href="rtk.htm" shape="rect" coords="420, 1, 515, 18" ALT="rtk.htm">
|
|
<area href="interopt.htm" shape="rect" coords="350, 1, 415, 19" ALT="interopt.htm">
|
|
<area href="ad.htm" shape="rect" coords="233, 1, 345, 19" ALT="ad.htm">
|
|
<area href="winnt.htm" shape="rect" coords="165, 1, 223, 19" ALT="winnt.htm">
|
|
<area href="dev.htm" shape="rect" coords="67, 1, 165, 19" ALT="dev.htm">
|
|
<area href="../default.htm" shape="rect" coords="13, 1, 65, 20" ALT = "../default.htm"></map>
|
|
<img rectangle="(233,1) (345, 19) ad.htm" rectangle="(165,1) (223, 19) winnt.htm" rectangle="(67,1) (165, 19) dev.htm" rectangle="(13,1) (65, 20) ../default.htm" src="router.gif" alt="router.gif (3874 bytes)" border="0" usemap="#FPMap0" width="536" height="26"></td>
|
|
<td width="3%" height="28"></td>
|
|
<td width="21%" height="28"></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="40">
|
|
<tr>
|
|
<td width="2%" height="19"></td>
|
|
<td width="98%" height="19">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="2%" height="21"></td>
|
|
<td width="98%" height="21">
|
|
<h1><font face="Verdana" color="#0080C0"><strong><small>Communicating with
|
|
the Netscape LDAP Server</small></strong></font></h1>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="2%" height="21"></td>
|
|
<td width="98%" height="21" valign="top"><small><font face="Verdana"> </font></small><p><font
|
|
face="Verdana" color="#0080C0"><strong><small>Requirements</small></strong></font><ul>
|
|
<li><font face="Verdana"><small>Install Netscape Server</small>.<br>
|
|
<small></small></font></li>
|
|
<li><font face="Verdana"><small>Install <a href="http://www.microsoft.com/adsi"> ADSI 2.5 or higher</a>.</small></font></li>
|
|
</ul>
|
|
<p><font face="Verdana" color="#0080C0"><strong><small>Connecting to the Netscape Server</small></strong></font><ul>
|
|
<li><small><font face="Verdana">You need to know the server you're connecting to.</font></small></li>
|
|
</ul>
|
|
<ul>
|
|
<li><font face="Verdana"><small>You need to know one of its naming contexts, for example:
|
|
O=Airius.com. If you don't know, please ask your Administrator.</small></font></li>
|
|
</ul>
|
|
<ul>
|
|
<li><font face="Verdana"><small>You need to know a valid username and
|
|
password. You can also use
|
|
the anonymous bind. <b> Note:</b> you cannot use the currently logged on user
|
|
who is connected to
|
|
Netscape. You must either supply credentials, or default it to anonymous by setting
|
|
username and password as an empty string. An empty string is different than
|
|
a NULL string.</small> <small><b>Note:</b> most of the ADS_AUTHENTICATION_ENUMs are not applicable when connecting to
|
|
the Netscape Server.</small></font></li>
|
|
</ul>
|
|
<blockquote>
|
|
<p><font face="Verdana"><small>Dim server<br>
|
|
Dim company<br>
|
|
Dim userName<br>
|
|
Dim password<br>
|
|
Dim dso</small><br>
|
|
<small>Dim adsPath<br>
|
|
<br>
|
|
<br>
|
|
server = "myServer"<br>
|
|
company = "O=Airius.com"</small><br>
|
|
<small>adsPath = "LDAP://" & server & "/" & company<br>
|
|
<br>
|
|
'-- Supplied Credentials -----<br>
|
|
userName = "cn=directory manager"<br>
|
|
password = "password"<br>
|
|
<br>
|
|
'----For anonymous credentials, use "" ---<br>
|
|
'userName = ""<br>
|
|
'password = ""<br>
|
|
<br>
|
|
Set dso = GetObject("LDAP:")<br>
|
|
Set cont = dso.OpenDSObject(adsPath, userName, password, 0)<br>
|
|
<br>
|
|
</small></font></p>
|
|
</blockquote>
|
|
<p><font face="Verdana" color="#0080C0"><strong><small>Enumerating a
|
|
Container</small></strong></font></p>
|
|
<p><font face="Verdana" color="#000000"><small>To enumerate a container, it's no different
|
|
than enumerating container in other LDAP servers or other ADSI providers.</small></font></p>
|
|
<p><font face="Verdana"><small>'--- Enumerating a container</small></font></p>
|
|
<blockquote>
|
|
<p><font face="Verdana"><small>
|
|
For Each obj In cont<br>
|
|
Debug.Print obj.Name & " (" & obj.Class & ")"<br>
|
|
Next</small></font></p>
|
|
</blockquote>
|
|
<p><font face="Verdana" color="#0080C0"><strong><small>Searching for Objects</small></strong></font></p>
|
|
<p><font face="Verdana"><small>Use ADO , or IDirectorySearch (for VC++ users) to search
|
|
for objects</small></font></p>
|
|
<p><font face="Verdana"><small>'--- For searching</small></font></p>
|
|
<blockquote>
|
|
<p><font face="Verdana"><small>
|
|
Dim con<br>
|
|
Dim command<br>
|
|
Dim rs<br>
|
|
</small></font></p>
|
|
<p><font face="Verdana"><small>Set con = CreateObject("ADODB.Connection")<br>
|
|
con.Provider = "ADsDSOObject"<br>
|
|
con.Properties("User ID") = userName<br>
|
|
con.Properties("Password") = password<br>
|
|
con.Open "ADSI"<br>
|
|
<br>
|
|
<br>
|
|
Set com = CreateObject("ADODB.Command")<br>
|
|
Set com.ActiveConnection = con<br>
|
|
com.CommandText = "SELECT ADsPath FROM '" & ADsPath & "' WHERE
|
|
cn='a*'"<br>
|
|
Set rs = com.Execute<br>
|
|
<br>
|
|
<br>
|
|
While Not (rs.EOF)<br>
|
|
Debug.Print rs.Fields("ADsPath")<br>
|
|
rs.MoveNext<br>
|
|
Wend<br>
|
|
<br>
|
|
</small></font></p>
|
|
</blockquote>
|
|
<p><font face="Verdana"><small><br>
|
|
The source code can be found in the <a href="../samples/interopt/netscape">\\samples\Interopt\Netscape</a>
|
|
directory.</small></font></p>
|
|
<p><font face="Verdana"> </font></td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|