IsInRole Question

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I created a usergroup on my W2K AD domain server and called it MyCustomRole

I added my user to it named User Name fully qualified is Mydomain\Bob

I can see that My.user.name Is OK its Mydomain\Bob But when I run the line

If My.User.IsInRole("MyCustomRole") Then

it returns false.

What am I doing wrong?

Any help would be greatly appreciated.

Bob
 
Hi

I am not familar with AD.
But here is a link about a script which will list all the group certian
user belongs to.
You may try to run the script to see the MyCustomRole is in the list.
List User Group
http://www.rlmueller.net/List User Groups.htm

For detailed information about AD, I think you may try to post in the
newsgroup below.
microsoft.public.adsi.general
or
microsoft.public.win2000.active_directory

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thanks, very interesting but it does not solve my problem.

I need My.user.isinrole("MycustomGroup") to return true if a My.user is in
the group MyCustomGroup on my domain controller.
It does not work.

I can see that my.User is in the correct domain and my.user is a member of
administrators

If I use
If My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator)

or use

If My.User.IsInRole("Administrators")

It returns true which Is Ok, The user is part of the administrators group

The two above use builtin groups. I can get the correct result on any
built-in group on the domain. But when I add a new group to the domain eg
MyCustomGroup, then write

If My.User.IsInRole("MycustomGroup") it returns false

It looks like the IsinRole function only works with built-in roles.

Bob
 
Hi Bob,

I reviewed the thread and find that there is a similar issue in the
newsgroup below.Now I have replied to you, you may go and take a look.
Subject: IsInRole Question
Newsgroups: microsoft.public.dotnet.languages.vb

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Bob,
Have you tried qualifying the role name you pass to IsInRole?

If My.User.IsInRole("Mydomain\MyCustomRole") Then

See the following for more information:

http://msdn.microsoft.com/library/d...ncipalwindowsprincipalclassisinroletopic2.asp


--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


|I created a usergroup on my W2K AD domain server and called it MyCustomRole
|
| I added my user to it named User Name fully qualified is Mydomain\Bob
|
| I can see that My.user.name Is OK its Mydomain\Bob But when I run the line
|
| If My.User.IsInRole("MyCustomRole") Then
|
| it returns false.
|
| What am I doing wrong?
|
| Any help would be greatly appreciated.
|
| Bob
|
|
|
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top