473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Accessing an AD Group

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.
Nov 17 '05 #1
1 6256
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.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jaydeep | last post by:
Hello, I am facing a strange problem. Problem accessing remote database from ASP using COM+ server application having VB components (ActiveX DLL) installed. Tier 1 : ASP front End (IIS 5.0) Tire...
1
by: Julius Mong | last post by:
Dear all, I have something like this: <html... > <embed ...> </html> Am I out of luck if I wanted to access the embedded DOM and manipulate its content? Or if I have:
2
by: R. Readi | last post by:
Is it possible in UNIX/BSD? Just to give inode instead of path name for accessing files. Thanks, Rodrigo
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
1
by: Ankita | last post by:
Hi I have a webservice which has 2 webmethods: 1.One that returns a String 2.One that returns an ArrayLis I need to use this WebService in VBA environment. I am using the Webservices References...
6
by: X l e c t r i c | last post by:
I've been accessing this group through the WebTV interface. My days with WebTV are coming to an end. My question is how do I access this group with a PC. Is there a web site I go to ? If so,...
6
by: Chuck Anderson | last post by:
My knowledge of JavaScript is limited. I learn from example and then adapt those examples to suit my needs. I have stumped myself on this one. I have a form with checkboxes that I want to...
3
by: sam | last post by:
hello all, i am currently in the process of planning a piece of software to model polymerisation kinetics, and intend to use python for all the high-level stuff. the number-crunching is...
4
by: martin99 | last post by:
Hi, I know that Clickbank does not have an api utility (unlike Paypal etc) so it hard to get the data back to an application to check sales etc I see a POST in a PERL user group and they got...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.