2025-11-28 00:35:46 +09:00

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">&nbsp;</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 = &quot;myServer&quot;<br>
company = &quot;O=Airius.com&quot;</small><br>
<small>adsPath = &quot;LDAP://&quot; &amp; server &amp; &quot;/&quot; &amp; company<br>
<br>
'-- Supplied Credentials -----<br>
userName = &quot;cn=directory manager&quot;<br>
password = &quot;password&quot;<br>
<br>
'----For anonymous credentials, use &quot;&quot; ---<br>
'userName = &quot;&quot;<br>
'password = &quot;&quot;<br>
<br>
Set dso = GetObject(&quot;LDAP:&quot;)<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>
&nbsp;&nbsp; Debug.Print obj.Name &amp; &quot; (&quot; &amp; obj.Class &amp; &quot;)&quot;<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(&quot;ADODB.Connection&quot;)<br>
con.Provider = &quot;ADsDSOObject&quot;<br>
con.Properties(&quot;User ID&quot;) = userName<br>
con.Properties(&quot;Password&quot;) = password<br>
con.Open &quot;ADSI&quot;<br>
<br>
<br>
Set com = CreateObject(&quot;ADODB.Command&quot;)<br>
Set com.ActiveConnection = con<br>
com.CommandText = &quot;SELECT ADsPath FROM '&quot; &amp; ADsPath &amp; &quot;' WHERE
cn='a*'&quot;<br>
Set rs = com.Execute<br>
<br>
<br>
While Not (rs.EOF)<br>
&nbsp; Debug.Print rs.Fields(&quot;ADsPath&quot;)<br>
&nbsp; rs.MoveNext<br>
Wend<br>
<br>
</small></font></p>
</blockquote>
<p><font face="Verdana"><small><br>
The source code can be found in the&nbsp; <a href="../samples/interopt/netscape">\\samples\Interopt\Netscape</a>
directory.</small></font></p>
<p><font face="Verdana">&nbsp</font></td>
</tr>
</table>
</body>
</html>