Change User attribute in Active Directory by web (vb.net)

Archived from groups: microsoft.public.win2000.active_directory (More info?)

Hi

I have some problem, i modify attributs in .net by web but nothing
happends, i don;t have any exceptions :(, everything would be okey but
does'nt :(

the code :

dim Entry_ldap As New
DirectoryEntry("LDAP://hercena11.d450000.wro.mofnet.gov.pl",
login.text, Password.text)
Dim lista_atr() As String = {"mail"}
Dim Filter As String = ("(&(sAMAccountName=" & login.text &
")(objectclass=" & "user" & "))")
Dim my_ldap_user As DirectorySearcher = New
DirectorySearcher(entry_ldap, Filter, lista_atr)
my_ldap_user.PropertyNamesOnly = True
Dim result As SearchResult
result = my_ldap_user.FindOne()
result.GetDirectoryEntry.Properties("mail").Value = txt_maillst.Text
result.GetDirectoryEntry.CommitChanges()

thanks for all answers
malin
1 answer Last reply
More about change user attribute active directory
  1. Archived from groups: microsoft.public.win2000.active_directory (More info?)

    Malin,

    This might be better posted in the ADSI news groups. Joe K or Joe R or Marc
    S will probably have the answer very quickly for you. You also might want
    to specify which language this is ( I am sure that those in the know will
    see immediately.... ).

    --
    Cary W. Shultz
    Roanoke, VA 24012
    Microsoft Active Directory MVP

    http://www.activedirectory-win2000.com
    http://www.grouppolicy-win2000.com


    <malin@o2.pl> wrote in message
    news:1124436714.388597.3200@z14g2000cwz.googlegroups.com...
    > Hi
    >
    > I have some problem, i modify attributs in .net by web but nothing
    > happends, i don;t have any exceptions :(, everything would be okey but
    > does'nt :(
    >
    > the code :
    >
    > dim Entry_ldap As New
    > DirectoryEntry("LDAP://hercena11.d450000.wro.mofnet.gov.pl",
    > login.text, Password.text)
    > Dim lista_atr() As String = {"mail"}
    > Dim Filter As String = ("(&(sAMAccountName=" & login.text &
    > ")(objectclass=" & "user" & "))")
    > Dim my_ldap_user As DirectorySearcher = New
    > DirectorySearcher(entry_ldap, Filter, lista_atr)
    > my_ldap_user.PropertyNamesOnly = True
    > Dim result As SearchResult
    > result = my_ldap_user.FindOne()
    > result.GetDirectoryEntry.Properties("mail").Value = txt_maillst.Text
    > result.GetDirectoryEntry.CommitChanges()
    >
    > thanks for all answers
    > malin
    >
Ask a new question

Read More

Filter Login LDAP Active Directory Windows