![]() |
||
![]() |
![]() |
|
Samples Sorted by Development Platforms For a complete list, please browse the ADSI samples directory.
Getting Started Samples Getting started samples can be found here. The source code can be found in \\samples\start.
Application Samples Some samples listed below are actually working applications.
Samples Sorted by Providers (or Technologies)
Samples that Highlight ADSI Interfaces, APIs, and Technologies Technologies
Interfaces
APIs
Samples can also be found in the samples directory and on the Active Directory page.
Visual C++ source code: \\samples\General\ADsCmd This C++ sample code demonstrates how to enumerate and filter by getting a list of attributes from the schema and displaying attributes on an object. Usage: adscmd [list|dump] <ADsPath> Examples: adscmd dump WinNT://MYDOMAIN adscmd list LDAP://dc01/CN=Administrators, OU=Admin, DC=MyDomain, DC=Com
Visual C++ source Code: \\samples\General\ADQI ADQI allows you to find all of the interfaces related to ADSI that are supported for a given ADsPath. You can then use the interfaces to further manipulate the object.
Visual C++ source code: \\samples\General\DsSrch This code contains a command line executable which highlights the usage of IDirectorySearch, complete with the Preference option. Usage: dssrch /b <baseObject> /f <search_filter> [/f
<attrlist>] [/p <preference>=value>] [/u <UserName>
<Password>] [/t<flagName>=<value> baseObject = ADsPath of the base of the search
Asynchronous, AttrTypesOnly, DerefAliases, SizeLimit,
TimeLimit,
SecureAuth or UseEncrypt Value Yes/no for a Boolean and the respective integer for
integers. Either "Base", "OneLevel", or "Subtree" dssrch /b NDS://ntmarst/ms /f "(object Class=*)" /a
"ADsPath, name, description" /p searchScope=onelevel /p searchscope=onelevel
Visual C++ source code: \\samples\General\ADSIDump This application traverses a tree, visiting each object in the tree and getting the attributes on each object. All actions are recorded in a log file. Written using C++/ATL. Usage: ADSIDUMP ADsPath LogFile ADSIDUMP LDAP://OU=Dev,DC=Platforms,DC=Microsoft,DC=COM ntdev.log
Visual C++ source code: \\samples\General\ADOQuery This code demonstrates an ADO query against an LDAP provider. Only ADSI providers that support IDirectorySearch and OLE DB can work with ADO. ADSI ships two providers that are aware of OLE DB: LDAP and NDS.
Active Directory Windows Address Book ASP source code: \\samples\ASP\WAB The Windows address book searches for and displays users, groups, and contacts in Active Directory. It showcases an Active Directory search based on ambiguous name resolution (ANR). It also demonstrates an ADSI search using ADO against Active Directory. To run the samples, first you must move the global.asa (or append the existing global.asa) to the default web site directory.
Visual C++ source code:
\\samples\activedir\addgroup\VC This sample adds a Windows 2000 group under a container. The group can either be a security or a distribution list type. Other options for the group type are universal, global and domain local groups.
Visual C++ source code:
\\samples\activedir\attributes\VC This sample demonstrates how to find attributes by indexed value, GC replication, and type.
Active Directory: Bind To Parent Visual C++ source code:
\\samples\activedir\bindtoparent\VC This program finds a user and displays the user's container.
Visual Basic source code: \\samples\activedir\computer This sample creates a machine account under the Active Directory computer container. You may create a machine under an organizational unit. This program requires you to specify a machine account. By default (using the GPO-Group Policy Objects) in the Windows 2000 domain, every authenticated user is able to create a machine account.
Visual C++ source code:
\\samples\activedir\createuser\VC This sample creates a user under a specified container. It requires that you specify the user's relative distinguished name and downlevel name.
Visual C++ source code:
\\samples\activedir\credentials\VC This sample allows you to log on to the current domain with alternate credentials.
Active Directory: Find All Users in Global Catalog Visual C++ source code:
\\samples\activedir\gcallusers\VC
Active Directory: Get Domain Mode Visual C++ source code:
\\samples\activedir\getdomainmode This sample checks whether Active Directory is in mixed or native mode.
Visual C++ source code:
\\samples\ActiveDir\GetSchemaInfo This program queries the schema for the specified classes or attributes.
Active Directory: GUID Binding Visual C++ source code:
\\samples\ActiveDir\GUIDBinding Active Directory allows you to bind object by its GUID. This sample demonstrates binding to a GUID.
Active Directory: Well Known GUID Visual C++ source code:
\\samples\ActiveDir\WKGUID Active Directory has the concept of well known GUIDs. This is a well known place, normally a container, which is associated to a well known GUID.
Active Directory: Property List Visual C++ source code:
\\samples\ActiveDir\PropertyList This code demonstrates the use of PropertyList in Active Directory.
Visual C++ source code:
\\samples\ActiveDir\QueryUsers This sample finds a user in the current domain.
Visual C++ source code:
\\samples\ActiveDir\RootDSE This sample gets the RootDSE on a server and prints out the entries.
C++ Source code: \\samples\Extension\Tutorial\Step2 This is a step-by-step tutorial on how to create an ADSI extension. The first step is to create an early binding extension without implementing IADsExtension. The second step implements the IADsExtension to support late binding. This extension will extend a 'user' object on the LDAP provider. You can easily change it to other provider by modifying the DLL Registration code. You can use this source code as a code base for your extension. This sample code accompanies with the client code written in VB.
Visual C++ source code: \\samples\ActiveDir\User This program finds a user in the current Window 2000 domain, and displays its IADsUser properties.
Active Directory Other WellKnown Object Visual C++ source code:
\\samples\ActiveDir\OtherWKO\VC This program does the following:
Visual C++ source code:
\\samples\ActiveDir\SID\VC This program finds a user in the current Windows 2000
domain
Visual Basic source code: \\samples\WinNT\Binding\VB This code snippet illustrates how to bind to a domain, remote computer, or a user in a domain. It also shows how to bind an object with alternate credentials.
Visual Basic source code: \\samples\WinNT\Group\VB This sample is a walkthrough for managing a group life cycle, from the creation and enumeration of the group (both local and global), to the addition and removal of users and groups to the group.
Visual Basic source code: \\samples\WinNT\Computer\VB This sample demonstrates how to bind to a computer object, enumerate services, sessions, and resources, and create a file share.
Visual Basic source code: \\samples\WinNT\User\VB This sample demonstrates how to create a user, set a user's properties, and rename and delete a user.
Visual Basic source code: \\samples\WinNT\UsrMgr This sample is a WinNT User Management Application.
Visual Basic source code:
\\samples\WinNT\ChangePwd
Visual Basic source code: \\samples\WinNT\PrintQueue (short version), \\samples\WinNT\PrintQueue\App (long version) This code shows print queues for a given computer.
Visual Basic source code: \\samples\WinNT\ResetPwd This sample resets the user's password. The caller must have administrative privileges.
Perl source code: \\samples\Perl
Perl: Creating and Deleting an Object Perl source code: \\samples\Perl
Perl: Retrieving and Modifying Properties Perl source code: \\samples\Perl
C++ source code: \\samples\Provider The following is the installation procedure for the Active DS Sample Provider:
You will need to run install.bat to install the Sample Provider and set up the sample directory service in the registry. To view the sample provider:
|
|