473,395 Members | 1,968 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.

Getting the domain name of the current server

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 23 '05 #1
7 2876
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 23 '05 #2
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 23 '05 #3
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 23 '05 #4
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 23 '05 #5
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 23 '05 #6
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 23 '05 #7
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 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jach | last post by:
How can I get the domain, username and PC network name (Win 2000 Pro & Win XP Pro PC's) of the current logged on user (logged onto a domain and access an intranet page, Window 2000 server running...
10
by: Deano | last post by:
Hi, I feel I have a good learning opportunity here. I have been asked to knock up a simple db for managing lettings of rooms and halls. I'm confident about the design but want to make it...
3
by: Wysiwyg | last post by:
After a server created cookie is processed on the client I want it removed, cleared, or expired in the javascript block but have been unable to do this. If I set a cookie value in the server code...
10
by: Peter Afonin | last post by:
Hello, I have a simple client-side form that is checking the domain availability on the domain registrar's server: <FORM action="https://www.webnames.ru/scripts/RegTimeSRS.pl" method="post">...
5
by: Ron L | last post by:
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...
2
by: Scott M. Lyon | last post by:
I'm having some strange problems with a VB.NET application that I support. The application currently uses SystemInformation.UserName() and SystemInformation.UserDomainName() to determine who is...
10
by: Martin Robins | last post by:
I need to access the scheduler service on a network computer in order to manipulate it remotely from .NET; I have all of the necessary code to perform the manipulation and it works - great - but I am...
8
by: Jim in Arizona | last post by:
I was trying to have an email sent when the page loads but having some trouble with it. Our server is an IIS 6.0 with Framework 2.0. It is set to windows authentication (not anonymous). I...
4
by: shashank kadge | last post by:
hi all, i am trying to get local admin users and groups on a windows server. here is the C# code that i am using...
2
by: kelly.pearson | last post by:
Is this a bug? I am trying to write a cookie that can be accessed by various .Net applications on our domain. However, whenever I add the domain property to the cookie, no errors get thrown but...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.