Please consult the AD/ADSI documentation is MSDN for the correct AD or LDAP
syntax before you start using DirectoryServices.
Willy.
"MarkAurit" <Ma*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
The below works when the first parameter to DirectoryEntry is set to our
corporate AD domain, such as LDAP://FORD. But if I try for a group within
the domain, such as LDAP://FORD/TRUCKS, I get the error message
"an invalid dn syntax has been specified".
What is the syntax to look at a group?
Thanks, Mark
adEntry = new DirectoryEntry(corpDomain, "SE0017", "IAMsense1",
AuthenticationTypes.Secure);
adSearch = new System.DirectoryServices.DirectorySearcher(adEntry );
adSearch.Filter = ("(anr="+userAccount+")");
try
{
adResult=adSearch.FindOne();
searchCount = adResult.Properties.Values.Count;
}
The below works when the first parameter (cordDomain) to DirectoryEntry is
set to our corporate AD domain, such as LDAP://FORD. But if I try for a
group within the domain, such as LDAP://FORD/TRUCKS, I get the error
message
"an invalid dn syntax has been specified".
What is the syntax to look at a group?
Thanks, Mark
adEntry = new DirectoryEntry(corpDomain, "SE0017", "IAMsense1",
AuthenticationTypes.Secure);
adSearch = new System.DirectoryServices.DirectorySearcher(adEntry );
adSearch.Filter = ("(anr="+userAccount+")");
try
{
adResult=adSearch.FindOne();
searchCount = adResult.Properties.Values.Count;
}
P.S. "FORD" is just being used for an example.