By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,475 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

directoryservices

P: n/a
hello,

I'm trying to write code using the directoryservices namespace that'll
update some AD attributes however the code seems to be failing. I'm hoping
somebody can have a look at it and offer feedback or probably post sample
code:

It's failing at the update attribute level.
Sub ModifyUser(ByRef temp() As String)
' CN=mjtest,OU=SL Users,DC=softlanding,DC=local
Dim AccountDN As String = "CN=" + temp(0) + ",OU=SL
Users,DC=domain,DC=local"
Console.WriteLine(AccountDN)
Try
Dim ent As New DirectoryEntry("LDAP://" + AccountDN)
ent.Properties("otherTelephone").Add( Add("(425) 523 1462")
Console.WriteLine(ent.Properties("sAMAccountName") )

'ent.Properties("title").Value = "Test Title"
ent.CommitChanges()
Catch Ex As Exception
Console.WriteLine(Ex.Message)
End Try


End Sub

End Module

Any help is appreciated.

thanks
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.