Dim something as IADsUser

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Iguana Frank

    #1

    Dim something as IADsUser

    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.Director yServices, but IADsUser is not an option.

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

    Thanks!
  • Ken Tucker [MVP]

    #2
    Re: Dim something as IADsUser

    Hi,

    Use directorysearch er with filter of objectclass=use r. IADsUser is
    part of a com class it is not in the directoryservic es namespace.

    http://msdn.microsoft.com/library/de...her_filter.asp



    Ken
    ---------------------
    "Iguana Frank" <IguanaFrankSam NA@ifsna.ed> wrote in message
    news:75C336D4-8F23-49F1-BA25-879AF201E324@mi crosoft.com...
    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.Director yServices, but IADsUser is not an option.

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

    Thanks!


    Comment

    • Iguana Frank

      #3
      Re: Dim something as IADsUser

      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=U serAccounts,DC= ourdomain,DC=co mpany,DC=com

      I can get to other proerties just fine:

      msgbox DomainUser.Prop erties("GivenNa me") & " " & DomainUser.Prop erties("sn")

      returns Joe User

      http://msdn.microsoft.com/library/de...ema/c_user.asp

      The disabled property is not in that above list.

      Thanks!

      "Ken Tucker [MVP]" wrote:
      [color=blue]
      > Hi,
      >
      > Use directorysearch er with filter of objectclass=use r. IADsUser is
      > part of a com class it is not in the directoryservic es namespace.
      >
      > http://msdn.microsoft.com/library/de...her_filter.asp
      >
      > http://support.microsoft.com/default...b;en-us;306271
      >
      > Ken
      > ---------------------
      > "Iguana Frank" <IguanaFrankSam NA@ifsna.ed> wrote in message
      > news:75C336D4-8F23-49F1-BA25-879AF201E324@mi crosoft.com...
      > 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.Director yServices, but IADsUser is not an option.
      >
      > I'm trying to figure out if an account is disabled.
      >
      > Thanks!
      >
      >
      >[/color]

      Comment

      • Stampy
        New Member
        • Jul 2006
        • 3

        #4
        The property you need to read to determine whether an account is disabled is the User-Account-Control field:
        http://msdn.microsoft.com/library/de...untcontrol.asp

        This is a bitmask that will contain a 2 if the account is disabled -- you can find information on how a bitmask works in this article by the MS scripting guys:

        http://www.microsoft.com/technet/tec...y/default.aspx

        Comment

        Working...