first_page

ADAM and PowerShell

Buy this book at Amazon.com!Active Directory Application Mode (ADAM) has been a mystery to me until reading Klaus Salchner, his 2005 article, “LDAP, IIS and WinNT Directory Services.” His sweeping statements allow me to go further with the following:

  • ADAM allows me to work with Active Directory without needing a virtual (or actual) domain controller and a forest of machines and other resources. This is a great way for developers to casually play with the traditionally formal (scary) Active Directory/LDAP world.
  • ADAM encourages me to add more scalability and enterprise-centric ASP.NET applications. My assumption is that the goals, in the article “How To: Use Forms Authentication with Active Directory in ASP.NET 2.0,” are still achievable with ADAM.
  • ADAM is another alternative for an application design that would use the Registry, XML configuration, [Structured Storage](C:~shares\dataRoot\MSWord\Non-Fiction\Journal\Structured Storage) or a local database to store data.
  • ADAM does not “contaminate” the “real” LDAP data of the enterprise—and it also is readily available to the managers of such enterprise data.After ADAM was downloaded for my Windows 2003 Server Standard virtual machine (not RC2), it was time to get busy in PowerShell. First line:$l = "LDAP://localhost:389/O=SonghaySystem,C=US" This location, $l, is the ADAM instance generated by my responses to the wizard in %SystemRoot%\ADAM\adaminstall.exe. This location is used to get a new Directory Entry, $root:$root= New-Object System.DirectoryServices.DirectoryEntry($l) This root can be searched with a Directory Searcher:$root_searcher = New-Object System.DirectoryServices.DirectorySearcher($root) And the Searcher filter:$root_searcher.Filter = "(ObjectClass=group)" This is a search for all groups in the root. We search with:$root_searcher.FindAll() This produced output like this:Path

LDAP://localhost:389/O=SonghaySystem... LDAP://localhost:389/CN=LostAndFound... LDAP://localhost:389/CN=NTDS Quotas,... LDAP://localhost:389/CN=Roles,O=Song... LDAP://localhost:389/CN=Administrato... LDAP://localhost:389/CN=Users,CN=Rol... LDAP://localhost:389/CN=Readers,CN=R... Much of this PowerShell session came from the 2005 Channe9 video, “Adding users to Active Directory with .NET” by Robert Shelton of Microsoft.

rasx()