Most errors in ASP.NET applications where serverless binding and default
credentials are used are the result of anonymous binds being performed that
limit you access to AD. Since ASP.NET runs a local machine account by
default, ADSI and S.DS cannot use the current security context to infer a
domain controller and domain credentials to use the for the bind.
This is explained in much detail here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;329986
http://msdn.microsoft.com/library/d...tication_problems_on_asp_pages.asp?frame=true
If you add a DNS name in your path. a la LDAP://yourserver.com/path and add
a username, password and AuthenticationTypes.Secure or
AuthenticationTypesServerBind to your DirectoryEntry constructor, you will
likely be successful.
To read a groups membership, you just need to find the group and read it
member attribute.
If you want to get a user's complete security group membership, you need to
look at the tokenGroups attribute. This is much prefered to memberOf for
security purposes. I've written about this extensively in the other
newsgroup, so doing a google groups search for Kaplan and tokenGroups in
micrsoft.public.adsi.general should give you lots of hits and some good
code.
HTH,
Joe K.