Change password admin , hack win2k | Change password admin , hack win2k trang này đã được đọc lần Dim conn As New Dim rs As Dim oRoot As IADs Dim oDomain As IADs Dim sBase As String Dim sFilter As String Dim sDomain As String Dim sAttribs As String Dim sDepth As String Dim sQuery As String Dim user As IADsUser On Error GoTo errhandler: Set oRoot = GetObject("LDAP://rootDSE") work in the default domain sDomain = ("defaultNamingContext") Set oDomain = GetObject("LDAP://" & sDomain) sBase = "" Only get user name requested sFilter = "(&(objectCategory=person)(objectClass=user)(name=" _ & UserName & "))" sAttribs = "adsPath" sDepth = "subTree" sQuery = sBase & ";" & sFilter & ";" & sAttribs & ";" & sDepth _ "Data Source=Active Directory Provider;Provider=ADsDSOObject" Set rs = (sQuery) With rs If Not .EOF Then Set user = GetObject(rs("adsPath")) NewPassword ChangePassword = True End If End With errhandler: On Error Resume Next If Not rs Is Nothing Then If 0 Then Set rs = Nothing End If If Not conn Is Nothing Then If 0 Then Set conn = Nothing End If Set oRoot = Nothing Set oDomain = Nothing End Function