Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Testing value in AD using DirectoryService NS (VB.NET)

    I am using the DirectoryServices namespace to iterate through users in an OU and displaying their AD properties in the Output window. One property I'm particularly interested is the pwdLastSet, which identifies the checkbox indicating that the user must change their password at next login. It returns System.__ComObject every time and I need it to return a Boolean to be of any use to me. Below is what I copied out of the cmd window. Is there a way to get a meaningful value out of this property?

    >? User.Properties("pwdLastSet").Value
    {System.__ComObject}
    [System.__ComObject]: {System.__ComObject}

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Testing value in AD using DirectoryService NS (VB.NET)

    This is a guess, but try using the ADSI property instead of the Active Directory property (see Platform SDK: Directory Services - Mapping between IADsUser Properties and Active Directory Properties). I think that means:

    User.PasswordLastChanged

    This might not apply to .NET, but it's used in a script that is part of the Windows .NET Server Resource Kit, so... who knows?

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Serbia and Montenegro (Yugoslavia)
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testing value in AD using DirectoryService NS (VB.NET)

    I looked at that script example and made a vbs out of it. When you run it it tells you that .PasswordLastChanged is not supported by this object. I love those examples that Microsoft provides that are completely worthless.

    I will check out that link related to your ADSI suggestion. I'll let you know how it goes.

  4. #4
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Testing value in AD using DirectoryService NS (VB.NET)

    I get the same error, Mike. You might try posting the issue in the MS newsgroup microsoft.public.adsi.general; I lurk there and bug the nice people with questions from time to time, almost always getting a more educated response than what I'm giving you now. <img src=/S/wink.gif border=0 alt=wink width=15 height=15> Good luck!
    <font face="Comic Sans MS"><font color=blue>~Shane</font color=blue></font face=comic>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •