Enable Users to Change Their Passwords

Disables the User Cannot Change Password option, allowing the user to change their password.

 
 
 
 
 
5 Star
(1)
Add to favorites
Active Directory
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Problemas Código VB 2008
    1 Posts | Last post January 16, 2012
    • Prezados, bom dia.
      
       
      
      Tentei inserir o código abaixo numa aplicação desenvolvida em VB 2008, com a finalidade de desabilitar a opção "User Cannot Change Password" em contas de usuários no Active Directory:
      
       
      
      Const ADS_ACETYPE_ACCESS_DENIED_OBJECT = &H6
              Const CHANGE_PASSWORD_GUID = _
                  "{ab721a53-1e2f-11d0-9819-00aa0040529b}"
              Dim objUser, objSD, objDACL, arrTrustees
      
              objUser = GetObject _
                  ("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")
              objSD = objUser.Get("nTSecurityDescriptor")
              objDACL = objSD.DiscretionaryAcl
              arrTrustees = Array("nt authority\self", "everyone")
      
              For Each strTrustee In arrTrustees
                  For Each ace In objDACL
                      If (LCase(ace.Trustee) = strTrustee) Then
                          If ((ace.AceType = ADS_ACETYPE_ACCESS_DENIED_OBJECT) And _
                             (LCase(ace.ObjectType) = CHANGE_PASSWORD_GUID)) Then
                              objDACL.RemoveAce(ace)
                          End If
                      End If
                  Next
              Next
      
              objUser.Put("nTSecurityDescriptor", objSD)
              objUser.SetInfo()
      
      
      Porém a aplicação me retorna o seguinte erro:
      
       
      
      Error	1	'Array' is a type and cannot be used as an expression.
      
       
      
      Poderiam me ajudar a resolver mais este problema, pois tentei diversas formar e não consegui.