I saw a link to find out if AD was running, but am not too sure if the same applies to AD/AM. One caveat is that I should be able to check about any AD/AM instance (any domain) assuming I have permissions.
the same approach applies to AD or to AD LDS (lightweight directory services, new name for ADAM). .NET examples at http://msdn.microsoft.com/en-us/library/x8wxt72e(VS.71).aspx
Performing LDAP queries against AD/AM and AD are very close in functionality. You just need to include a DNS prefix in your bind string as well as the port (if it's not the default 389):
LDAP://ADAMServer:50000/DC=domain,DC=local
One major pain is the default absence of RootDSE in AD/AM. You can add it manually but by default you can't use those handy search filters that use the LDAP://Server/RootDSE syntax.
The ADAM instances are separated by port numbers so you will need to indicate a port based on the instance you want. You can find this in the Windows 2008 registry of the server at:
HKLM\SYSTEM\CurrentControlSet\Services\ADAM_InstanceName\Parameters
or you could perform a command line query:
c:\windows\adam\dsdbutil.exe "list instances"