PC Review


Reply
Thread Tools Rate Thread

Determining the computer's domain

 
 
JZ
Guest
Posts: n/a
 
      15th Aug 2003
Hi,

At run-time, I need to determine the domain on which the server is currently
joined. System.Environment doesn't provide me with the information that I
need through the UserDomainName property because that is the network domain
name associated with the current user. I need to know the domain (if the
server is currently logged on) like "mydomain.com".

Thank you in advance.

JZ


 
Reply With Quote
 
 
 
 
Günter Prossliner
Guest
Posts: n/a
 
      18th Aug 2003
string domain = Environment.UserDomainName;

GP

"JZ" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> At run-time, I need to determine the domain on which the server is

currently
> joined. System.Environment doesn't provide me with the information that I
> need through the UserDomainName property because that is the network

domain
> name associated with the current user. I need to know the domain (if the
> server is currently logged on) like "mydomain.com".
>
> Thank you in advance.
>
> JZ
>
>



 
Reply With Quote
 
Günter Prossliner
Guest
Posts: n/a
 
      19th Aug 2003
Ok. I should read to the end, before I click the "Reply Group" - Button!


"JZ" <(E-Mail Removed)> wrote in message
news:%23p4xJ%(E-Mail Removed)...
> Jerry's suggestion of using DsRoleGetPrimaryDomainInformation worked like

a
> charm. Thank you very much.
>
> Gunter - see my original post for why UserDomainName did not meet my

needs.
>
> If anyone is curious, I also tried using the System.Management namespace.

I
> believe that it could have provided me with the information that I was
> looking for but permissions on "root\CIMV2" wouldn't allow ASPNET to
> retrieve the information (and I didn't feel like changing the security).
>
> "Günter Prossliner" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > string domain = Environment.UserDomainName;
> >
> > GP
> >
> > "JZ" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hi,
> > >
> > > At run-time, I need to determine the domain on which the server is

> > currently
> > > joined. System.Environment doesn't provide me with the information

that
> I
> > > need through the UserDomainName property because that is the network

> > domain
> > > name associated with the current user. I need to know the domain (if

the
> > > server is currently logged on) like "mydomain.com".
> > >
> > > Thank you in advance.
> > >
> > > JZ
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining Users Logged into Domain =?Utf-8?B?S2VuIENsYXJr?= Microsoft Windows 2000 Active Directory 1 4th Mar 2005 08:26 PM
determining the web domain name Jonny Wilkinson Microsoft ASP .NET 3 11th Oct 2004 04:46 PM
Determining the domain name used Jonny Microsoft ASP .NET 2 8th Oct 2004 10:33 PM
Determining Domain Controllers for users Robert Cohen Microsoft Windows 2000 Advanced Server 2 15th Oct 2003 03:44 PM
Determining the computer's domain JZ Microsoft C# .NET 2 19th Aug 2003 07:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:51 AM.