469,604 Members | 2,376 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,604 developers. It's quick & easy.

IsInRole Question

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


Dec 28 '05 #1
4 4285
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%20User%20Groups.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.

Dec 29 '05 #2
Bob
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.A dministrator)

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

""Peter Huang" [MSFT]" <v-******@online.microsoft.com> wrote in message
news:Z1**************@TK2MSFTNGXA02.phx.gbl...
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%20User%20Groups.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.

Dec 29 '05 #3
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.

Dec 30 '05 #4
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/de...roletopic2.asp
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Bob" <bd*****@sgiims.com> wrote in message
news:u7*************@TK2MSFTNGP15.phx.gbl...
|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
|
|
|
|
|
|
Jan 3 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Somyos Jinkow | last post: by
6 posts views Thread by JIM.H. | last post: by
5 posts views Thread by arjun | last post: by
8 posts views Thread by Oliver Rainer | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.