473,395 Members | 1,379 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 always false

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.

Nov 18 '05 #1
6 4314
Is username returning a local machine administrator rather than domain
administrator? Since you didn't specify that username is
myDomain\Administrator, it isn't clear. If the user is a domain
administrator, it should work just like you have it.

Dale Preston
MCAD, MCSE, MCDBA
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
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.

Nov 18 '05 #2
insert <identity impersonate="true" /> in webconfig
Nov 18 '05 #3
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
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?

If you are programming in C#, then I think you need to escape the "\". Try
User.IsInRole("myDomain\\Administrators").
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #4
Duh.... Good eye!
"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:OE**************@TK2MSFTNGP12.phx.gbl...
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
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?

If you are programming in C#, then I think you need to escape the "\". Try
User.IsInRole("myDomain\\Administrators").
--
John Saunders
johnwsaundersiii at hotmail

Nov 18 '05 #5
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
Hi Dale,
User.Identity.Name returns "myDomain\myUseranme"
but both User.IsInRole("MyDomain\Administrator") and User.IsInRole("BUILTIN\Administrator") returns false any Idea?
Did you try doubling the "\"?
--
John Saunders
johnwsaundersiii at hotmail

"Dale" wrote:
Is username returning a local machine administrator rather than domain
administrator? Since you didn't specify that username is
myDomain\Administrator, it isn't clear. If the user is a domain
administrator, it should work just like you have it.

Dale Preston
MCAD, MCSE, MCDBA
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
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.


Nov 18 '05 #6
"John Saunders" <jo**************@notcoldmail.com> wrote in message
news:eW**************@TK2MSFTNGP09.phx.gbl...
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:C3**********************************@microsof t.com...
Hi Dale,
User.Identity.Name returns "myDomain\myUseranme"
but both User.IsInRole("MyDomain\Administrator") and

User.IsInRole("BUILTIN\Administrator") returns false
any Idea?


Did you try doubling the "\"?


Sorry, didn't notice you were using VB.NET until after I posted this.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #7

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. ...
2
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:...
0
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...
2
by: Dave | last post by:
Hi, I'm testing the IsInRole method on my app. I'm using Integrated security so I'm not sure if that has something to do with it. I have a groups table which I want to secure certain portions...
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...
4
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
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: =?Utf-8?B?dmluZWV0YmF0dGE=?= | last post by:
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...
1
by: =?Utf-8?B?RjVGNUY1?= | last post by:
I use the following function to ascertain if the current user is in ann AD security group. It appears to work, except if the group contains any space characters, it always returns false. For...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.