https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/251176&feed=atom&action=history
Microsoft KB Archive/251176 - Revision history
2024-03-29T05:58:52Z
Revision history for this page on the wiki
MediaWiki 1.39.3
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/251176&diff=376774&oldid=prev
X010: Text replacement - """ to """
2020-07-21T12:51:34Z
<p>Text replacement - """ to """</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:51, 21 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l61">Line 61:</td>
<td colspan="2" class="diff-lineno">Line 61:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> strUserDn, strDistListDn, strAdmin, strAdminPwd</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> strUserDn, strDistListDn, strAdmin, strAdminPwd</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> strLdapSrv = <del style="font-weight: bold; text-decoration: none;">&quot;</del>LDAP://localhost:5292<del style="font-weight: bold; text-decoration: none;">&quot;</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> strLdapSrv = <ins style="font-weight: bold; text-decoration: none;">"</ins>LDAP://localhost:5292<ins style="font-weight: bold; text-decoration: none;">"</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> strRoot = <del style="font-weight: bold; text-decoration: none;">&quot;</del>o=Microsoft<del style="font-weight: bold; text-decoration: none;">&quot;</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> strRoot = <ins style="font-weight: bold; text-decoration: none;">"</ins>o=Microsoft<ins style="font-weight: bold; text-decoration: none;">"</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> strMemberPath = <del style="font-weight: bold; text-decoration: none;">&quot;</del>,ou=Members,<del style="font-weight: bold; text-decoration: none;">&quot; </del>+ strRoot</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> strMemberPath = <ins style="font-weight: bold; text-decoration: none;">"</ins>,ou=Members,<ins style="font-weight: bold; text-decoration: none;">" </ins>+ strRoot</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> strUserCn = <del style="font-weight: bold; text-decoration: none;">&quot;</del>cn=JohnDoe<del style="font-weight: bold; text-decoration: none;">&quot;</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> strUserCn = <ins style="font-weight: bold; text-decoration: none;">"</ins>cn=JohnDoe<ins style="font-weight: bold; text-decoration: none;">"</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> strUserDn = strUserCn + strMemberPath</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> strUserDn = strUserCn + strMemberPath</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> strDistListDn = strLdapSrv + <del style="font-weight: bold; text-decoration: none;">&quot;</del>/<del style="font-weight: bold; text-decoration: none;">&quot; </del>+ strRoot + _ </div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> strDistListDn = strLdapSrv + <ins style="font-weight: bold; text-decoration: none;">"</ins>/<ins style="font-weight: bold; text-decoration: none;">" </ins>+ strRoot + _ </div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;">&quot;</del>/ou=DistributionLists/cn=KmBriefList<del style="font-weight: bold; text-decoration: none;">&quot;</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> <ins style="font-weight: bold; text-decoration: none;">"</ins>/ou=DistributionLists/cn=KmBriefList<ins style="font-weight: bold; text-decoration: none;">"</ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> strAdmin = <del style="font-weight: bold; text-decoration: none;">&quot;</del>cn=Administrator,ou=Members,<del style="font-weight: bold; text-decoration: none;">&quot; </del>+ strRoot</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> strAdmin = <ins style="font-weight: bold; text-decoration: none;">"</ins>cn=Administrator,ou=Members,<ins style="font-weight: bold; text-decoration: none;">" </ins>+ strRoot</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> strAdminPwd = <del style="font-weight: bold; text-decoration: none;">&quot;</del>password<del style="font-weight: bold; text-decoration: none;">&quot;</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> strAdminPwd = <ins style="font-weight: bold; text-decoration: none;">"</ins>password<ins style="font-weight: bold; text-decoration: none;">"</ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 'Bind to the specific Distribution List using Administrator credentials</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 'Bind to the specific Distribution List using Administrator credentials</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> Set adsDistList = GetObject(<del style="font-weight: bold; text-decoration: none;">&quot;</del>LDAP:<del style="font-weight: bold; text-decoration: none;">&quot;</del>)</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> Set adsDistList = GetObject(<ins style="font-weight: bold; text-decoration: none;">"</ins>LDAP:<ins style="font-weight: bold; text-decoration: none;">"</ins>)</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Set adsDistList = adsDistList.OpenDSObject(strDistListDn, _ </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Set adsDistList = adsDistList.OpenDSObject(strDistListDn, _ </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> strAdmin, strAdminPwd, CLng(0))</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> strAdmin, strAdminPwd, CLng(0))</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ' Remove the member from the ones in the distribution list</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ' Remove the member from the ones in the distribution list</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> adsDistList.PutEx ADS_ATTR_DELETE, <del style="font-weight: bold; text-decoration: none;">&quot;</del>dlMember<del style="font-weight: bold; text-decoration: none;">&quot;</del>, Array(strUserDN)</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> adsDistList.PutEx ADS_ATTR_DELETE, <ins style="font-weight: bold; text-decoration: none;">"</ins>dlMember<ins style="font-weight: bold; text-decoration: none;">"</ins>, Array(strUserDN)</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 'Flush the property cache and update the directory</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> 'Flush the property cache and update the directory</div></td></tr>
</table>
X010
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/251176&diff=138099&oldid=prev
3155ffGd: importing KB archive
2020-07-18T16:15:27Z
<p>importing KB archive</p>
<p><b>New page</b></p><div><div id="nsbanner"><br />
<br />
<div id="bannerrow1"><br />
<br />
{|<br />
| Knowledge Base<br />
|<br />
|}<br />
<br />
<br />
</div><br />
<div id="TitleRow"><br />
<br />
= <span id="KB251176"></span>How to Programmatically Remove Members from Distribution Lists =<br />
<br />
<br />
</div><br />
<br />
</div><br />
<div id="nstext" valign="BOTTOM"><br />
<br />
Article ID: 251176<br />
<br />
Article Last Modified on 2/4/2000<br />
<br />
<br />
-----<br />
<br />
APPLIES TO<br /><br />
<br /><br />
<br />
* Microsoft Site Server 3.0 Standard Edition<br />
<br />
<br />
-----<br />
<br />
<div class="notice_section"><br />
<br />
This article was previously published under Q251176<br />
<br />
</div><br />
<div class="summary_section"><br />
<br />
== SUMMARY ==<br />
<br />
This article describes how to programmatically remove a member from a specific distribution list in Site Server 3.0 Membership Directory using Active Directory Service Interfaces (ADSI) 2.5 and VBScript.<br />
<br />
</div><br />
<div class="moreinformation_section"><br />
<br />
== MORE INFORMATION ==<br />
<br />
To remove a member from a distribution list in Site Server 3.0, perform the following steps:<br />
# Bind to the Distribution List in which you want to remove the user.<br />
# Remove the Distinguished Name (DN) of the user you want to remove from to the Distribution List.<br />
<br />
The following code illustrates this procedure:<br />
<pre class="codesample"> Const ADS_ATTR_DELETE = 4<br />
<br />
Dim strDistList, strLdapSrv, strRoot, strMemberPath, strUserCn, _ <br />
strUserDn, strDistListDn, strAdmin, strAdminPwd<br />
<br />
strLdapSrv = &quot;LDAP://localhost:5292&quot;<br />
strRoot = &quot;o=Microsoft&quot;<br />
strMemberPath = &quot;,ou=Members,&quot; + strRoot<br />
strUserCn = &quot;cn=JohnDoe&quot;<br />
strUserDn = strUserCn + strMemberPath<br />
strDistListDn = strLdapSrv + &quot;/&quot; + strRoot + _ <br />
&quot;/ou=DistributionLists/cn=KmBriefList&quot;<br />
strAdmin = &quot;cn=Administrator,ou=Members,&quot; + strRoot<br />
strAdminPwd = &quot;password&quot;<br />
<br />
'Bind to the specific Distribution List using Administrator credentials<br />
Set adsDistList = GetObject(&quot;LDAP:&quot;)<br />
Set adsDistList = adsDistList.OpenDSObject(strDistListDn, _ <br />
strAdmin, strAdminPwd, CLng(0))<br />
<br />
' Remove the member from the ones in the distribution list<br />
adsDistList.PutEx ADS_ATTR_DELETE, &quot;dlMember&quot;, Array(strUserDN)<br />
<br />
'Flush the property cache and update the directory<br />
adsDistList.SetInfo<br />
<br />
'Destroy the objects<br />
Set adsDistList = Nothing</pre><br />
=== REFERENCES ===<br />
<br />
[[../251174|251174]] How to Programmatically Add Members to Distribution ListsFor information on Active Directory Service Interfaces version 2.5, go to the following location in the [http://www.msdn.microsoft.com/library/default.htm MSDN Online Library]:<br />
<div class="indent"><br />
<br />
SDK Documentation / Platform SDK / Networking and Directory Services / Active Directory Service Interfaces<br />
<br />
<br />
</div><br />
<br />
</div><br />
Keywords: kbhowto KB251176<br />
<br />
<div class="footer"><br />
<br />
<br /><br />
<br />
<br />
-----<br />
<br />
[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]<br />
<br />
<span>© Microsoft Corporation. All rights reserved.</span><br />
<br />
<br />
</div><br />
<br />
</div></div>
3155ffGd