ADScmd: Active Directory Service Command-Line Sample

Click to open or copy the files for the ADScmd sample.

This simple command-line program shows how to use the Active Directory Service Interfaces to browse and display objects of any Directory Service.

Usage

adscmd [list|dump] <ADsPath>

Examples

On a Windows NT system, the following will dump the properties of SomeUser in MYDOMAIN:

   adscmd dump WinNT://MYDOMAIN/SomeUser

On an NDS system, the following will list the top of the MYTREE tree:

   adscmd list NDS://MYTREE

The namespace (such as "WinNT" or "NDS") is case-sensitive.

Files

This sample has the following main files:

File Description
Main.cxx Main program
Dump.cxx Functions to dump properties of an object
Enum.cxx Functions to enumerate children of a container
Util.cxx Helper functions

Building SDK Samples

This sample uses the following keywords:

_stricmp; adsbuildenumerator; adsbuildvararraystr; adsenumeratenext; adsgetobject; allocateunicodestring; ansitounicodestring; bail_on_failure; bail_on_null; coinitialize; dodump; dolist; dumpobject; enumobject; exit; failed; free_bstr; free_interface; freeunicodestring; get; get_class; get_mandatoryproperties; get_name; get_schema; getpropertylist; localalloc; localfree; memset; multibytetowidechar; printf; printlongformat; printproperty; printusage; printvariant; printvariantarray; put_filter; queryinterface; release; safearrayaccessdata; safearraydestroy; safearraygetelement; safearraygetlbound; safearraygetubound; safearrayunaccessdata; strcpy; sysfreestring; unicodetoansistring; varbstrfromdate; variantclear; variantinit; wcslen; widechartomultibyte; zeromemory