By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 958 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

Getting the domain name of the current server

P: n/a
I have an application I am developing which is using remoting to have a
smart client connect to a remote database via IIS. There are certain
functions that we only want the user to be able to access if they are
members of a certain group on the server. When the application is deployed,
the group will be a domain group, but for our developers the group is a
local group on the development machines. To check the group membership, I
am using the HttpContext.Current.User.IsInRole(groupName) where groupname is
checked as
System.Environment.MachineName & "\" & groupname
and then as
<domainName> & "\" & groupname
My problem is how to get the domain name of the machine that is hosting the
remoting. In our development environment, the domain of the development
server is different from the domain the users are defined in, so we can't
use the System.Environment.UserDomainName.

Can anyone tell me how I can get the name of the domain that the remoting
host is a member of?

TIA
Ron Lounsbury
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
this is inelegant and I am sure that there is a better way, but...
why not just create a remotable object that returns this information to
callers?

there should also be a way to do this with Active Directory...

Nov 21 '05 #2

P: n/a
Stand__Sure
Thanks for the response. That is essentially what I am trying to do,
but I haven't been able to find a way to say "what domain is the server I am
on a member of".

Ron L
"stand__sure" <st*********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
this is inelegant and I am sure that there is a better way, but...
why not just create a remotable object that returns this information to
callers?

there should also be a way to do this with Active Directory...

Nov 21 '05 #3

P: n/a
Have you solved this? I have the same problem except that my application can
be deployed to any computer. I need to determine, at runtime, whether to use
a local group or a domain group to form the group name for IsInRole.
--
Doug Van Vreede

Nov 21 '05 #4

P: n/a
Doug

No, I haven't come up with anything. For the moment I am coding around it
and moving on. If you find anything, I would be very interested.

Ron L

"Doug V" <Do***@discussions.microsoft.com> wrote in message
news:1B**********************************@microsof t.com...
Have you solved this? I have the same problem except that my application
can
be deployed to any computer. I need to determine, at runtime, whether to
use
a local group or a domain group to form the group name for IsInRole.
--
Doug Van Vreede

Nov 21 '05 #5

P: n/a
I resorted to using some Win32 code to call NetGetJoinInformation. That
gives me the computer's domain. I'm still trying both forms of group names
(System.Environment.MachineName & <domainName>). I'd like a way to avoid
that.
--
Doug Van Vreede

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.