G
Guest
Hi,
i've written some code that changes the user information (eg givenname, sn,
department, ...) from a user in AD. The code runs without an error/exception.
The only annoying thing is that the changes aren't executed. here is my code :
Dim deEntry As New DirectoryEntry
deEntry.Path = "LDAP://myDomainController"
Dim dsSearch As New DirectorySearcher(deEntry)
dsSearch.Filter = "(&(objectClass=user)(samaccountname=" & strLogin
& "*))"
Dim entry As DirectoryEntry = dsSearch.FindOne.GetDirectoryEntry
With entry
.Properties("sn").Value = nieuweMdw.achternaam
.Properties("givenname").Value = nieuweMdw.voornaam
.Properties("department").Value = nieuweMdw.afdeling
.Properties("title").Value = nieuweMdw.functie
.Properties("company").Value = nieuweMdw.firma
.Properties("mail").Value = nieuweMdw.email
.Properties("telephonenumber").Value = nieuweMdw.telnr
End With
entry.AuthenticationType = AuthenticationTypes.Secure
entry.CommitChanges()
entry.RefreshCache()
entry.Close()
does anyone see my problem? Thx!
i've written some code that changes the user information (eg givenname, sn,
department, ...) from a user in AD. The code runs without an error/exception.
The only annoying thing is that the changes aren't executed. here is my code :
Dim deEntry As New DirectoryEntry
deEntry.Path = "LDAP://myDomainController"
Dim dsSearch As New DirectorySearcher(deEntry)
dsSearch.Filter = "(&(objectClass=user)(samaccountname=" & strLogin
& "*))"
Dim entry As DirectoryEntry = dsSearch.FindOne.GetDirectoryEntry
With entry
.Properties("sn").Value = nieuweMdw.achternaam
.Properties("givenname").Value = nieuweMdw.voornaam
.Properties("department").Value = nieuweMdw.afdeling
.Properties("title").Value = nieuweMdw.functie
.Properties("company").Value = nieuweMdw.firma
.Properties("mail").Value = nieuweMdw.email
.Properties("telephonenumber").Value = nieuweMdw.telnr
End With
entry.AuthenticationType = AuthenticationTypes.Secure
entry.CommitChanges()
entry.RefreshCache()
entry.Close()
does anyone see my problem? Thx!