Visual Basic Script Active Directory Actualizar Informacion Política de privacidad de plasticaweb

Academia Plasticaweb

Temas de la semana Visual Basic Script Active Directory Actualizar Informacion
¿Cómo llegar?:
Pasos :

Private Sub Comando119_Click()

On Error GoTo Err_Comando119_Click

Const ADS_SCOPE_SUBTREE = 2

Set objConnection = CreateObject("ADODB.Connection")

Set objCommand = CreateObject("ADODB.Command")

objConnection.Provider = "ADsDSOObject"

objConnection.Open "Active Directory Provider"

Set objCommand.ActiveConnection = objConnection

objCommand.Properties("Page Size") = 1000

objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE

Usuario = Me.usuariopan

objCommand.CommandText = _

"SELECT distinguishedName FROM 'LDAP://dc=midominio,dc=com' WHERE objectCategory='user' AND sAMAccountName='" & Usuario & "'"

Set objRecordSet = objCommand.Execute

CANTIDAD = objRecordSet.RecordCount

objUser.OfficeLocations = "MADRID"

objUser.SetInfo

Exit_Comando119_Click:

Exit Sub

Err_Comando119_Click:

MsgBox Err.Description & Err.Number

Resume Exit_Comando119_Click

End Sub

 

Notas :