I have a program that I have created (VB.NET 2003) that takes anexcel spread sheet and creates a user based on what is in theSS. This is working properly. Now, I want the be able to takeanother spreadsheet and update information of the users in thatsheet. Here is my code on how I initially create the user:
Dim myDirectoryEntry As DirectoryServices.DirectoryEntry
Dim myDE As DirectoryServices.DirectoryEntry
Dim myEntries As DirectoryServices.DirectoryEntries
RootDSE = RootDSE.Insert(7, mOU)
myDE = New DirectoryServices.DirectoryEntry(RootDSE)
myEntries = myDE.Children
myDirectoryEntry = myEntries.Add("CN=" & mUserName, "user")
myDirectoryEntry.Properties("samAccountName").Valu e = mUserName
... Do other properties here
myDirectoryEntry.CommitChanges()
Now, when I run the second spread sheet it looks to see if theusername already exists and if it does then it checks to see ifthe first and last names match. If they match then they aresupposed to update the rest of the fields. So assuming I have acomplete match, this is the code that I do:
'Same as others above
myDirectoryEntry = myEntries.Find("CN=" & mUserName)
I get an error that say that the object is not found on theserver. I know that it is there... I can not figure out thecorrect syntax for the life of me... help!
BTW this program is running on a W2K domain controller.
Thanks
--------------------------------
From: Brian Denning
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>5RohlFfWuE6FY90ku5tt0g==</Id>