473,408 Members | 2,813 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,408 software developers and data experts.

Interacting with Local & Domain Users

Hi people,

How can I validate if a string with the format "MYDOMAIN\MyUser" is really the logon name of one of the users on the Active Directory (on my domain), or if it is a local user on the server ("MYSERVER\MyUser")?

What I want to do is to receive a string (in the format "XXXXX\YYYYY") and verify if it is the logon name of a domain or a local user (throwing an exception if neither of them).

Thanks for all the help you could give me!!
Nov 21 '05 #1
1 1040
Gabriel,
You could use System.DirectoryServices.DirectorySearcher or
System.DirectoryServices.DirectoryEntry to look in either LDAP (Active
Directory) or WinNT (Windows 2000 or Windows XP) to see if the profile
exists.

For details see:
http://msdn.microsoft.com/library/de...oryObjects.asp

This page might be the most relevent, but I would suggest reviewing the
entire section:
http://msdn.microsoft.com/library/de...components.asp

Hope this helps
Jay
"Gabriel José Giraldo Navarro" <ga*********@hotmail.com> wrote in message
news:eX**************@TK2MSFTNGP10.phx.gbl...
Hi people,

How can I validate if a string with the format "MYDOMAIN\MyUser" is really
the logon name of one of the users on the Active Directory (on my domain),
or if it is a local user on the server ("MYSERVER\MyUser")?

What I want to do is to receive a string (in the format "XXXXX\YYYYY") and
verify if it is the logon name of a domain or a local user (throwing an
exception if neither of them).

Thanks for all the help you could give me!!
Nov 21 '05 #2

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

Similar topics

0
by: R. Clausen | last post by:
Have two machines with Win 2K 5.00.2195 (Machine 'A' has SP4, Machine 'B' has SP3) and both have DB2 UDB v8.1 FP4 all loaded fresh (not an upgrade). Machine 'A' gives the error 'Logon failure:...
6
by: Rob | last post by:
Hi, I am working on a project that requires a Windows Service which performs the following file transfer functions. 1. It monitors a specific local directory on a Windows 2003 Server. 2. When...
3
by: jimmyfishbean | last post by:
Hi, My client has the following network structure: 2 Windows 2003 servers : Server 1 - Web server running IIS, ftp import and export folder, ASP.NET SOAP web service and asp code on here....
16
by: JonnyD | last post by:
I am working on a project to build a reporting web app from an exsiting database that is controled by a local application. The application that has control over the database creates a lock file to...
1
by: Paul | last post by:
Hi all, Thanks in advance for your help. I would like to know how to add a computer to a domain, and a domain user to a local group. Cheers Paul
5
by: Rocky | last post by:
Hi, I have a webform, with 2 textboxs and a submit button. In the text box1, i enter a username and in textbox2 I enter the computer name. Both the username and computer name is in active...
0
by: el dio | last post by:
Hi, i'm trying to add domain user to a local Windows group. Imagine I have domain 'myDomain', domain user 'myDomain\domainUser', my computer is 'myComputer', local group is 'Guests'. I used...
5
by: Michael Howes | last post by:
I'm writing a utility to manage a machines *local* accounts in c# I am getting all the users in a specific Group just fine but when I want to get some of the information on each user from their...
8
by: Michael Howes | last post by:
I have some code that manages local user logins. When I create a new user I want to set the password to expire every x days and the number of failed login attempts before the account is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.