473,327 Members | 2,094 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,327 software developers and data experts.

Checking group membership

In ASP.Net I'm trying to check for some users membership of a group.
The user is not nessicerily the user requesting the page, and I do not have
the users password.

So far I've created the following piece code:

DirectoryEntry group = new DirectoryEntry(FormatAdsiSyntax(strGroup) +
",group", "domain\\user", "password");
Object q = group.Invoke("IsMember", new object[]
{FormatAdsiSyntax(strUserID)});
if (q.Equals(false))
{
// ......
}

The function FormatAdsiSyntax simply returns a string like:
WinNT://domain/objectname
The user and password supplied is an account operator in the domain.

On my Windows XP workstation this piece of code works all right, even though
it's pretty slow.
But on a Windows 2000 Server an exception occours in the "Invoke" code line,
saying "The network path was not found".

Shouldn't this work on Win2K also ?

Can I somehow make this group membership check in another and faster way ?
(We'll not be upgrading to a 2003 Server AD until the beginning of next
year).

Thanks in advance,
Jan Nielsen
Nov 17 '05 #1
0 1412

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

Similar topics

2
by: innesm | last post by:
Hi, Although I havent been able to find any documentation to confirm it, it looks like any change to a windows local group's membership is only reflected in the group editing UI (and the...
1
by: Karen Hill | last post by:
I would like to be able to programatically check for group membership in an access database. For example, I would like to be able to check is someone is in the admin group before the program does...
3
by: Scott | last post by:
I need to be able to verify group membership in my C# application. All the examples I seem to find show how to query the BUILTIN groups. I need to be able to query the DOMAIN groups. Can I have...
9
by: Terry E Dow | last post by:
Howdy, I am having trouble with the objectCategory=group member.Count attribute. I get one of three counts, a number between 1-999, no member (does not contain member property), or 0. Using...
2
by: Fred | last post by:
I need to check if a web client is a member of a domain security group so I can direct them to different aspx web forms for different groups. Thanx in advance.
7
by: Sameh Ahmed | last post by:
Hello there IsInrole gives ya the means to check if the current or impersonated user belongs to a specific windows role or group. is there a way to do the same without using ADSI to check if...
17
by: TC | last post by:
In the past I always regarded user/group security as fairly tight. It is tricky to implement, but once implemented properly, it can't be cracked except through a dedicated effort. Recently,...
4
by: Paul.Pucciarelli | last post by:
So I have some 'groups' which 'users' can join. There is no enrollment limit on these 'groups'. How should I store the list of users enrolled in the group? I'd like to be able to quickly...
1
by: Troels Arvin | last post by:
Hello, Quoting http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/ com.ibm.db2.luw.sql.ref.doc/doc/r0000935.html : Group privileges are not considered for any table or view specified...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.