473,666 Members | 2,517 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IsInRole does not work as expected

Hi,

I created a local group on server and added my self to that group.

I am using the following code in my web page to check the membership of the
loggedin user against the Windows group on the same server.

User.IsInRole(@ 'MachineName\gr oupName') . The above always return me false.
If i restart my machine then this returns true. Any clue why?

MachineName - is same as the server name on which the code is being run.

Windows Authentication is enabled and i checked the User.Identity and that
is coming correct and as expected. Subsequently i want to extend this to
check for some thing like DOMAIN\WINDOWSG ROUP.

Thanks in advance.
--
MCAD
Vineet Batta

Jan 6 '07 #1
1 1324
Even on restart of machine it return false. Any pointers?

--
MCAD
Vineet Batta
"vineetbatt a" wrote:
Hi,

I created a local group on server and added my self to that group.

I am using the following code in my web page to check the membership of the
loggedin user against the Windows group on the same server.

User.IsInRole(@ 'MachineName\gr oupName') . The above always return me false.
If i restart my machine then this returns true. Any clue why?

MachineName - is same as the server name on which the code is being run.

Windows Authentication is enabled and i checked the User.Identity and that
is coming correct and as expected. Subsequently i want to extend this to
check for some thing like DOMAIN\WINDOWSG ROUP.

Thanks in advance.
--
MCAD
Vineet Batta
Jan 6 '07 #2

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...
2
2260
by: Mong | last post by:
Hi all, Well I reckon I've just read through 200 messages on this subject and tried every combination of every setting the is and I'm still getting a return of false on IsInRole. Here's my code: Dim rolUI_Admin as String Dim wp As WindowsPrincipal rolUI_Admin = "DOMAIN/DOM_ACL_TestAdmins"
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...
0
1007
by: Peter | last post by:
Hello! I have a strange problem with .IsInRole method. When I use this method on my development machine everything works fine. However when I deploy my application on a production server this method does not work correct. I use the following code: String DefaultAdminRole = @"dom\admgroup"; String UserName="";
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
4
4423
by: Bob | last post by:
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.
10
7015
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...
0
2038
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
8454
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
8785
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
6200
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5671
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
4200
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
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
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
2012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
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.