Dim something as IADsUser

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using vb.net, I saw a bunch of examples of using this variable type.
However, I never saw what I need to reference this, or didn't understand what
it was saying (more likely). All the examples start out with

Dim usr As IADsUser

But, I need more than that, since it tells me that IADsUser is not defined.

I have Imports System.DirectoryServices, but IADsUser is not an option.

I'm trying to figure out if an account is disabled.

Thanks!
 
Hi,

Use directorysearcher with filter of objectclass=user. IADsUser is
part of a com class it is not in the directoryservices namespace.

http://msdn.microsoft.com/library/d...irectoryservices_directorysearcher_filter.asp

http://support.microsoft.com/default.aspx?scid=kb;en-us;306271

Ken
---------------------
Using vb.net, I saw a bunch of examples of using this variable type.
However, I never saw what I need to reference this, or didn't understand
what
it was saying (more likely). All the examples start out with

Dim usr As IADsUser

But, I need more than that, since it tells me that IADsUser is not defined.

I have Imports System.DirectoryServices, but IADsUser is not an option.

I'm trying to figure out if an account is disabled.

Thanks!
 
I probably didn't explain this far enough, or I'm still missing something. I
have the user as a directory entry, I'm looping through an OU, I didn't see
the difference that the searcher was able to do compared to what I have, I
could be confused.

The problem, that I have, with DirectoryEntry is that there doesn't appear
to be a way to get the Account Disabled property.

This is the path of my DirectoryEntry:

LDAP://CN=JoeUser,OU=UserAccounts,DC=ourdomain,DC=company,DC=com

I can get to other proerties just fine:

msgbox DomainUser.Properties("GivenName") & " " & DomainUser.Properties("sn")

returns Joe User

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/adschema/c_user.asp

The disabled property is not in that above list.

Thanks!
 
Back
Top