Interacting with Local & Domain Users

  • Thread starter Thread starter =?iso-8859-1?Q?Gabriel_Jos=E9_Giraldo_Navarro?=
  • Start date Start date
?

=?iso-8859-1?Q?Gabriel_Jos=E9_Giraldo_Navarro?=

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!!
 
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/d...vboriIntroductionToActiveDirectoryObjects.asp

This page might be the most relevent, but I would suggest reviewing the
entire section:
http://msdn.microsoft.com/library/d...us/vbcon/html/vbtskcreatingadsicomponents.asp

Hope this helps
Jay


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!!
 
Back
Top