Announcement

Collapse
No announcement yet.

Disable Active Directory user account

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Disable Active Directory user account

    Hi everyone!

    I am new to scripting but please bear up with me. I am trying to run the script below to disable a user account in Windows 2000 Server Active Directory.

    Const ADS_UF_ACCOUNTDISABLE = 2

    Set objUser = GetObject _
    ("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")
    intUAC = objUser.Get("userAccountControl")

    objUser.Put "userAccountControl", intUAC OR ADS_UF_ACCOUNTDISABLE
    objUser.SetInfo

    When I run this code, I get the 8007202B error: A referral was returned from the server. Could anyone assist me with this please? I would highly appreciate it.

  • #2
    Re: Disable Active Directory user account

    This maybe a daft question but you have changed the LDAP query to point to your own domain and not the MS test one from Script Center.

    topper.
    * Shamelessly mentioning "Don't forget to add reputation!"

    Comment


    • #3
      Re: Disable Active Directory user account

      Hi topper,

      I certainly appreciate your hint. Actually, I never modified the script from Script Center--which is why I am not getting any good result.

      The LDAP query should point to my domain. Again, thanx. I will try to play around with the LDAP line a bit.

      Further hints on this, still much appreciated.

      Comment

      Working...
      X