Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / October 2005

Tip: Looking for answers? Try searching our database.

Domain name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob - 26 Oct 2005 03:36 GMT
Hi,

I have an application that wants to implement its own security model on its
own objects.
I have a list of usernames that have access to the internal object.
From the username, I can perfrom a lookup in Active Directory of the user
object.
What I want to do now is get the domain name of the user. I want the olf
NT4-style netbios name of the domain, not the low-level part of the DNS name
of the domain.

why?
because "development.abc.com" and "development.xyz.com" are both in my
forest, but one is called "abcdev" and the other "xyzdev".  It is the latter
names that I am interested in.

TIA

Bob
Alun Jones - 26 Oct 2005 04:01 GMT
> I have an application that wants to implement its own security model on
> its own objects.
[quoted text clipped - 6 lines]
>
> why?

Because it's the canonical format for user identifiers in a domain
environment, that's why.

You can identify a user with a UPN or with domain\user in modern versions of
Windows, or as domain\user in older versions (NT 4.0 and before, IIRC).

So, it makes some sense to use domain\user format.

In Win32 API, you'd use CrackSingleName.

In .NET, you can use WindowsIdentity, which takes a UPN string argument in
its constructor, and has a Name() member to return the domain\user format.

What are you waiting for?

Alun.
~~~~
[Please don't email posters, if a Usenet response is appropriate.]
Signature

Texas Imperial Software   | Find us at http://www.wftpd.com or email
23921 57th Ave SE         | alun@wftpd.com.
Washington WA 98072-8661  | WFTPD, WFTPD Pro are Windows FTP servers.
Fax/Voice +1(425)807-1787 | Try our NEW client software, WFTPD Explorer.

Joe Kaplan (MVP - ADSI) - 26 Oct 2005 12:45 GMT
I suggest doing a p/invoke to the Windows TranslateName API.

Joe K.

> Hi,
>
[quoted text clipped - 15 lines]
>
> Bob

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.