473,509 Members | 3,543 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\groupName') . 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\WINDOWSGROUP.

Thanks in advance.
--
MCAD
Vineet Batta

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

--
MCAD
Vineet Batta
"vineetbatta" 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\groupName') . 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\WINDOWSGROUP.

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
1348
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. ...
2
2226
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:...
6
4318
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
2272
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...
0
997
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...
8
13131
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...
4
4410
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...
10
7000
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...
0
2031
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
7237
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,...
0
7137
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...
1
7073
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
4732
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...
0
3218
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...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
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 ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
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...

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.