473,624 Members | 2,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.IsInRol e("MyCustomRole ") Then

it returns false.

What am I doing wrong?

Any help would be greatly appreciated.

Bob


Dec 28 '05 #1
4 4422
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.publi c.adsi.general
or
microsoft.publi c.win2000.activ e_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.isinrol e("MycustomGrou p") 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.IsInRol e(ApplicationSe rvices.BuiltInR ole.Administrat or)

or use

If My.User.IsInRol e("Administrato rs")

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.IsInRol e("MycustomGrou p") it returns false

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

Bob

""Peter Huang" [MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:Z1******** ******@TK2MSFTN GXA02.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.publi c.adsi.general
or
microsoft.publi c.win2000.activ e_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.publi c.dotnet.langua ges.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.IsInRol e("Mydomain\MyC ustomRole") 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******** *****@TK2MSFTNG P15.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.IsInRol e("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
1359
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. One question that I had, is there anything different that has to be done with AD when using this method? For example, I'm populating a list box with the members of this group, and when I attach using LDAP I had to use...
0
1112
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 network, it is instantaneous. Even more interesting is that IsInRole checks for a local group (e.g. Administrators), not a domain group, so I am not sure why it would make such a difference. Either version of IsInRole (with a string parameter and an...
1
1529
by: Somyos Jinkow | last post by:
why ? i use User.IsInRole in user control (file.aspx). I use ASP.NEt code behide.
6
4327
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 does isInRole work? Thanks, Jim.
5
2280
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 group membership.But here I am failing .The isinRole call on the Principal object is returning true for buitin groups and some local groups but not ALL. I read in one of the previous threads that this was a bug in Framework 1 in which all groups...
8
13140
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 app), webmethoda are using the Principalpermssion attribute () for identification. Result --> does not work
10
7014
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 group, user bob, group TestUsers and then try to determine if My.user.Isinrole("TestUsers") I always get a false, which is incorrect. If I put Bob as part of Administrators or any other built-in group on the DC and look at...
1
1446
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 but that's not that simple to code. Would it not be possible to create a new User object representing a user so I can user the IsInRole method?
0
2037
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 config is as follows... <system.web> <authorization> <deny users="?" /> </authorization>
0
8249
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8179
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8633
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1493
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.