473,395 Members | 1,471 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,395 software developers and data experts.

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 4407
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kevin | last post by:
Hello all, I'm unable to get the IsInRole method to work with my AD domain. There is a global group that I am a member of, when I query that group using the IsInRole method, it returns false. ...
0
by: Alek Davis | last post by:
Hello, I noticed an interesting problem. When calling WindowsPrincipal.IsInRole over dial-up (VPN), this function takes 1-2 minute(s) to return. On the intranet or when disconnected from the...
1
by: Somyos Jinkow | last post by:
why ? i use User.IsInRole in user control (file.aspx). I use ASP.NEt code behide.
6
by: JIM.H. | last post by:
Hello, username=user.identity.name trueFalse=User.IsInRole("myDomain\Administrators")? First line return user name as administrator but second line returns false? What might be the reason? Or how...
5
by: arjun | last post by:
Hi All, I am developing a A webpage to be seen in a page viewer webpart(Sharepoint 2003). The page is supposed to check for the current user name and then check the user membership in some local...
8
by: Oliver Rainer | last post by:
Hi, I have the following problem... Pre-requisites: Installation of an Asp.net webservice on a IIS5 server (win2k). Anonymous access is not allowed, only using windows authentication (intranet...
10
by: Bob | last post by:
This a bit of a second post on same subject, my apologies. IsinRole function only works with built-in roles. If I create a new group on my domain controller then add an existing user to that...
1
by: Peter Bons | last post by:
Hi, I have a question, I know that I can determine whether an user belongs to a certain AD group. But what if I want to check for a serie of users? I could use the DirectoryServices classes...
0
by: ronscottlangham | last post by:
I have a web page that any authenticated user can access, but I dynamically enable/disable other asp.net controls on the web page based on the Role that they are in via C# code behind. My web...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.