Get.Roles / IPrincipal

R

Ryan

Hi Guys.

I'm having problem getting Get.Roles to work on my production environment
(Multiple Domains) I have it working locally on my domain test environment
however.


When executing via a page on asp.net on the production box (client machine)
Response.Write(Environment.UserDomainName)

The Domain returns BRISBANE .

In my production envirnonment to get roles I used the below statement which
worked correctly.

Response.Write(Page.User.IsInRole(Environment.UserDomainName & "\testman"))

this returned - ADVENTURE-WORKS\testman

The Primary Domain in the production envirnonment is UrbisJHD.COM so calling
"Environment.UserDomainName" would be incorrect?
I have therefore tried to use UrbisJHD\GroupName on the production
environment?

I have tried a number of strings :

sPath2 = "UrbisJHD.com\UrbisJHD Melbourne\Knowledge
Management\Groups\Lasso - PAVals"

sPath3 = "UrbisJHD.com\Knowledge Management\Groups\Lasso - PAVals"

sPath4 = "UrbisJHD Melbourne\Knowledge Management\Groups\Lasso - PAVals"

sPath5 = "UrbisJHD\Knowledge Management\Groups\Lasso - PAVals"

sPath6 = "UrbisJHD\Lasso - PAVals"



If Page.User.IsInRole(sPath2) = True Then

Response.Write("<P><b>Lasso PAVals</b></P")

GroupCount = GroupCount + 1

Else



Thanks for your help

Ryan.
 
D

Dominick Baier [DevelopMentor]

Hello Ryan,

the correct format is DOMAIN\GroupName

is the web server domain joined? Under which account is your application
running?
 
R

Ryan

Hi Dominick, thanks for your reply.

the webserver (where IIS is installed) is connected to the Urbisjhd.com
domain. <-- this machine is not under the Brisbane.UrbisJHD.com domain, just
UrbisJHD.com

a client machine which tried to access the intranet, is under the
Brisbane.UrbisJHD.com domain.

IIS is running in Windows Authentication / Basic mode.

If you need anymore information let me know (as you can see i'm not really
good at understanding domains etc)

I wont however be able to start testing again until next Monday.

Ryan.
 
R

Ryan

Heres a bit more information, the actual path that shows for the user which
is in the specified group is :

UrbisJHD.com/UrbisJHD Melbourne/Knowledge Management/Groups/Lasso - PAVals

Thanks

Ryan
 
D

Dominick Baier [DevelopMentor]

Hello Ryan,

which OS?

under which account is the web app running? a domain account?
 
R

Ryan

IIS is running on Windows 2003 ..

What do you mean by which account is the web app running?

Thanks
Ryan
 
D

Dominick Baier [DevelopMentor]

Hello Ryan,

well - your app is hosted in a process. Under which account is the process
running?

you can see that in the app pools settings in IIS.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
IIS is running on Windows 2003 ..

What do you mean by which account is the web app running?

Thanks
Ryan
Hello Ryan,

which OS?

under which account is the web app running? a domain account?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Dominick, thanks for your reply.

the webserver (where IIS is installed) is connected to the
Urbisjhd.com domain. <-- this machine is not under the
Brisbane.UrbisJHD.com domain, just UrbisJHD.com

a client machine which tried to access the intranet, is under the
Brisbane.UrbisJHD.com domain.

IIS is running in Windows Authentication / Basic mode.

If you need anymore information let me know (as you can see i'm not
really good at understanding domains etc)

I wont however be able to start testing again until next Monday.

Ryan.

"Dominick Baier [DevelopMentor]"

Hello Ryan,

the correct format is DOMAIN\GroupName

is the web server domain joined? Under which account is your
application running?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Guys.

I'm having problem getting Get.Roles to work on my production
environment (Multiple Domains) I have it working locally on my
domain test environment however.

When executing via a page on asp.net on the production box (client
machine) Response.Write(Environment.UserDomainName)

The Domain returns BRISBANE .

In my production envirnonment to get roles I used the below
statement which worked correctly.

Response.Write(Page.User.IsInRole(Environment.UserDomainName &
"\testman"))

this returned - ADVENTURE-WORKS\testman

The Primary Domain in the production envirnonment is UrbisJHD.COM
so
calling
"Environment.UserDomainName" would be incorrect?
I have therefore tried to use UrbisJHD\GroupName on the production
environment?
I have tried a number of strings :
sPath2 = "UrbisJHD.com\UrbisJHD Melbourne\Knowledge
Management\Groups\Lasso - PAVals"
sPath3 = "UrbisJHD.com\Knowledge Management\Groups\Lasso - PAVals"

sPath4 = "UrbisJHD Melbourne\Knowledge Management\Groups\Lasso -
PAVals"

sPath5 = "UrbisJHD\Knowledge Management\Groups\Lasso - PAVals"

sPath6 = "UrbisJHD\Lasso - PAVals"

If Page.User.IsInRole(sPath2) = True Then

Response.Write("<P><b>Lasso PAVals</b></P")

GroupCount = GroupCount + 1

Else

Thanks for your help

Ryan.
 
R

Ryan

DefaultAppPool

Ryan.

Dominick Baier said:
Hello Ryan,

well - your app is hosted in a process. Under which account is the process
running?

you can see that in the app pools settings in IIS.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
IIS is running on Windows 2003 ..

What do you mean by which account is the web app running?

Thanks
Ryan
Hello Ryan,

which OS?

under which account is the web app running? a domain account?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Dominick, thanks for your reply.

the webserver (where IIS is installed) is connected to the
Urbisjhd.com domain. <-- this machine is not under the
Brisbane.UrbisJHD.com domain, just UrbisJHD.com

a client machine which tried to access the intranet, is under the
Brisbane.UrbisJHD.com domain.

IIS is running in Windows Authentication / Basic mode.

If you need anymore information let me know (as you can see i'm not
really good at understanding domains etc)

I wont however be able to start testing again until next Monday.

Ryan.

"Dominick Baier [DevelopMentor]"

Hello Ryan,

the correct format is DOMAIN\GroupName

is the web server domain joined? Under which account is your
application running?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Guys.

I'm having problem getting Get.Roles to work on my production
environment (Multiple Domains) I have it working locally on my
domain test environment however.

When executing via a page on asp.net on the production box (client
machine) Response.Write(Environment.UserDomainName)

The Domain returns BRISBANE .

In my production envirnonment to get roles I used the below
statement which worked correctly.

Response.Write(Page.User.IsInRole(Environment.UserDomainName &
"\testman"))

this returned - ADVENTURE-WORKS\testman

The Primary Domain in the production envirnonment is UrbisJHD.COM
so
calling
"Environment.UserDomainName" would be incorrect?
I have therefore tried to use UrbisJHD\GroupName on the production
environment?
I have tried a number of strings :
sPath2 = "UrbisJHD.com\UrbisJHD Melbourne\Knowledge
Management\Groups\Lasso - PAVals"
sPath3 = "UrbisJHD.com\Knowledge Management\Groups\Lasso - PAVals"

sPath4 = "UrbisJHD Melbourne\Knowledge Management\Groups\Lasso -
PAVals"

sPath5 = "UrbisJHD\Knowledge Management\Groups\Lasso - PAVals"

sPath6 = "UrbisJHD\Lasso - PAVals"

If Page.User.IsInRole(sPath2) = True Then

Response.Write("<P><b>Lasso PAVals</b></P")

GroupCount = GroupCount + 1

Else

Thanks for your help

Ryan.
 
D

Dominick Baier [DevelopMentor]

Hello Ryan,

and what do you see when you switch to the identity tab in the default app
pool??
---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
DefaultAppPool

Ryan.

Hello Ryan,

well - your app is hosted in a process. Under which account is the
process running?

you can see that in the app pools settings in IIS.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
IIS is running on Windows 2003 ..

What do you mean by which account is the web app running?

Thanks
Ryan
"Dominick Baier [DevelopMentor]"
Hello Ryan,

which OS?

under which account is the web app running? a domain account?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Dominick, thanks for your reply.

the webserver (where IIS is installed) is connected to the
Urbisjhd.com domain. <-- this machine is not under the
Brisbane.UrbisJHD.com domain, just UrbisJHD.com

a client machine which tried to access the intranet, is under the
Brisbane.UrbisJHD.com domain.

IIS is running in Windows Authentication / Basic mode.

If you need anymore information let me know (as you can see i'm
not really good at understanding domains etc)

I wont however be able to start testing again until next Monday.

Ryan.

"Dominick Baier [DevelopMentor]"

Hello Ryan,

the correct format is DOMAIN\GroupName

is the web server domain joined? Under which account is your
application running?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Guys.

I'm having problem getting Get.Roles to work on my production
environment (Multiple Domains) I have it working locally on my
domain test environment however.

When executing via a page on asp.net on the production box
(client machine) Response.Write(Environment.UserDomainName)

The Domain returns BRISBANE .

In my production envirnonment to get roles I used the below
statement which worked correctly.

Response.Write(Page.User.IsInRole(Environment.UserDomainName &
"\testman"))

this returned - ADVENTURE-WORKS\testman

The Primary Domain in the production envirnonment is
UrbisJHD.COM
so
calling
"Environment.UserDomainName" would be incorrect?
I have therefore tried to use UrbisJHD\GroupName on the
production
environment?
I have tried a number of strings :
sPath2 = "UrbisJHD.com\UrbisJHD Melbourne\Knowledge
Management\Groups\Lasso - PAVals"
sPath3 = "UrbisJHD.com\Knowledge Management\Groups\Lasso -
PAVals"
sPath4 = "UrbisJHD Melbourne\Knowledge Management\Groups\Lasso -
PAVals"

sPath5 = "UrbisJHD\Knowledge Management\Groups\Lasso - PAVals"

sPath6 = "UrbisJHD\Lasso - PAVals"

If Page.User.IsInRole(sPath2) = True Then

Response.Write("<P><b>Lasso PAVals</b></P")

GroupCount = GroupCount + 1

Else

Thanks for your help

Ryan.
 
R

Ryan

Hey Dominick. Didn't try what you suggest below.

However it was working ok. I was pointing to the wrong domain (they have
multiple domains and i'm not sure how they are configured)

I used reflection code that was somewhere in this forum to return the groups
of that user from the active directory, which pointed out the correct domain
to me!

The admins there couldnt give me this information.

Thanks for your help
Ryan.


Dominick Baier said:
Hello Ryan,

and what do you see when you switch to the identity tab in the default app
pool??
---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
DefaultAppPool

Ryan.

Hello Ryan,

well - your app is hosted in a process. Under which account is the
process running?

you can see that in the app pools settings in IIS.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
IIS is running on Windows 2003 ..

What do you mean by which account is the web app running?

Thanks
Ryan
"Dominick Baier [DevelopMentor]"
Hello Ryan,

which OS?

under which account is the web app running? a domain account?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Dominick, thanks for your reply.

the webserver (where IIS is installed) is connected to the
Urbisjhd.com domain. <-- this machine is not under the
Brisbane.UrbisJHD.com domain, just UrbisJHD.com

a client machine which tried to access the intranet, is under the
Brisbane.UrbisJHD.com domain.

IIS is running in Windows Authentication / Basic mode.

If you need anymore information let me know (as you can see i'm
not really good at understanding domains etc)

I wont however be able to start testing again until next Monday.

Ryan.

"Dominick Baier [DevelopMentor]"

Hello Ryan,

the correct format is DOMAIN\GroupName

is the web server domain joined? Under which account is your
application running?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Guys.

I'm having problem getting Get.Roles to work on my production
environment (Multiple Domains) I have it working locally on my
domain test environment however.

When executing via a page on asp.net on the production box
(client machine) Response.Write(Environment.UserDomainName)

The Domain returns BRISBANE .

In my production envirnonment to get roles I used the below
statement which worked correctly.

Response.Write(Page.User.IsInRole(Environment.UserDomainName &
"\testman"))

this returned - ADVENTURE-WORKS\testman

The Primary Domain in the production envirnonment is
UrbisJHD.COM
so
calling
"Environment.UserDomainName" would be incorrect?
I have therefore tried to use UrbisJHD\GroupName on the
production
environment?
I have tried a number of strings :
sPath2 = "UrbisJHD.com\UrbisJHD Melbourne\Knowledge
Management\Groups\Lasso - PAVals"
sPath3 = "UrbisJHD.com\Knowledge Management\Groups\Lasso -
PAVals"
sPath4 = "UrbisJHD Melbourne\Knowledge Management\Groups\Lasso -
PAVals"

sPath5 = "UrbisJHD\Knowledge Management\Groups\Lasso - PAVals"

sPath6 = "UrbisJHD\Lasso - PAVals"

If Page.User.IsInRole(sPath2) = True Then

Response.Write("<P><b>Lasso PAVals</b></P")

GroupCount = GroupCount + 1

Else

Thanks for your help

Ryan.
 
P

Patrick.O.Ige

Anyway good you got it working..
How is the weather in Brisbane?
Patrick

Ryan said:
Hey Dominick. Didn't try what you suggest below.

However it was working ok. I was pointing to the wrong domain (they have
multiple domains and i'm not sure how they are configured)

I used reflection code that was somewhere in this forum to return the groups
of that user from the active directory, which pointed out the correct domain
to me!

The admins there couldnt give me this information.

Thanks for your help
Ryan.


Dominick Baier said:
Hello Ryan,

and what do you see when you switch to the identity tab in the default app
pool??
---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
DefaultAppPool

Ryan.

"Dominick Baier [DevelopMentor]"

Hello Ryan,

well - your app is hosted in a process. Under which account is the
process running?

you can see that in the app pools settings in IIS.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
IIS is running on Windows 2003 ..

What do you mean by which account is the web app running?

Thanks
Ryan
"Dominick Baier [DevelopMentor]"
Hello Ryan,

which OS?

under which account is the web app running? a domain account?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Dominick, thanks for your reply.

the webserver (where IIS is installed) is connected to the
Urbisjhd.com domain. <-- this machine is not under the
Brisbane.UrbisJHD.com domain, just UrbisJHD.com

a client machine which tried to access the intranet, is under the
Brisbane.UrbisJHD.com domain.

IIS is running in Windows Authentication / Basic mode.

If you need anymore information let me know (as you can see i'm
not really good at understanding domains etc)

I wont however be able to start testing again until next Monday.

Ryan.

"Dominick Baier [DevelopMentor]"

Hello Ryan,

the correct format is DOMAIN\GroupName

is the web server domain joined? Under which account is your
application running?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
Hi Guys.

I'm having problem getting Get.Roles to work on my production
environment (Multiple Domains) I have it working locally on my
domain test environment however.

When executing via a page on asp.net on the production box
(client machine) Response.Write(Environment.UserDomainName)

The Domain returns BRISBANE .

In my production envirnonment to get roles I used the below
statement which worked correctly.

Response.Write(Page.User.IsInRole(Environment.UserDomainName &
"\testman"))

this returned - ADVENTURE-WORKS\testman

The Primary Domain in the production envirnonment is
UrbisJHD.COM
so
calling
"Environment.UserDomainName" would be incorrect?
I have therefore tried to use UrbisJHD\GroupName on the
production
environment?
I have tried a number of strings :
sPath2 = "UrbisJHD.com\UrbisJHD Melbourne\Knowledge
Management\Groups\Lasso - PAVals"
sPath3 = "UrbisJHD.com\Knowledge Management\Groups\Lasso -
PAVals"
sPath4 = "UrbisJHD Melbourne\Knowledge Management\Groups\Lasso -
PAVals"

sPath5 = "UrbisJHD\Knowledge Management\Groups\Lasso - PAVals"

sPath6 = "UrbisJHD\Lasso - PAVals"

If Page.User.IsInRole(sPath2) = True Then

Response.Write("<P><b>Lasso PAVals</b></P")

GroupCount = GroupCount + 1

Else

Thanks for your help

Ryan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
DewittMill
Top