Visual Basic 2008 and Active Directory computer description modifications 
Author Message
 Visual Basic 2008 and Active Directory computer description modifications

ok, it appears that i have run into a spot that i am not able to
figure out on my own.  Let me first say that i have hobbled together
this SUB from things i found on the internet and tutorials. Here is my
issue...I can search AD for the description of the computer and
display it out but am unable to figure out if the

"   results.Getdirectoryentry().properties("description").value =
"Turek, Brett - Dell Laptop"
        results.CommitChanges()
        results.Close()
"
part will actually do what i want, change the description in AD of the
computer.  Can anyone look this over and let me know if i am on the
right path?  How about some examples of how to change things in AD?

*******************
Complete Code:
*******************

Public Sub Button5_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button5.Click
        'Rename Description
        Dim userID = "DOMAIN\USERNAME"
        Dim password = "PASSWORD"
        Dim rootEnty As New DirectoryEntry("LDAP://
OU=Computers,OU=City,OU=MAR,OU=Customer,DC=us,DC=company,DC=com",
userID, password)
        Dim Searcher As New DirectorySearcher(rootEnty)
        Searcher.Filter = "(CN=computerName)"

        results = Searcher.FindOne()

        'For Each result In results
        item =
results.GetDirectoryEntry().Properties("description").Value
        'Next
        MsgBox(item) ' output to check that look up worked.

        results.Getdirectoryentry().properties("description").value =
"Turek, Brett - Dell Laptop"
        results.CommitChanges()
        results.Close()
    End Sub



Mon, 21 Mar 2011 20:56:28 GMT  
 Visual Basic 2008 and Active Directory computer description modifications
  This group is for VB (mainly v. 5 and 6). Your post
is about VB.Net.

  For VB.Net you can try the groups below, or any other
group with "dotnet" or "vsnet" in the name:

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.vsnet.general

  If you are new to VB.Net, you need to know that there
are "two VBs" in use, which are entirely different beyond
their similar syntax. Likewise, there are two kinds of VB
newsgroups.

You need to be aware of the difference between "the two VBs"
when looking for newsgroups. The same applies when searching
for sample code. VB and VB.Net code can look very similar in
some cases, but code in one system is not applicable to the other.



Mon, 21 Mar 2011 21:09:42 GMT  
 Visual Basic 2008 and Active Directory computer description modifications
Thanks!

I have re posted here:
http://groups.google.com/group/microsoft.public.dotnet.languages.vb/b...

Hopefully this will be the right place.

thanks,
brett



Mon, 21 Mar 2011 21:48:26 GMT  
 Visual Basic 2008 and Active Directory computer description modifications

ok, it appears that i have run into a spot that i am not able to
figure out on my own.  Let me first say that i have hobbled together
this SUB from things i found on the internet and tutorials. Here is my
issue...I can search AD for the description of the computer and
display it out but am unable to figure out if the

You may also want to check out the following resource:

http://directoryprogramming.net/default.aspx

Paul
~~~~
Microsoft MVP (Visual Basic)



Mon, 21 Mar 2011 22:05:26 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Visual Basic 2008 & Visual Studio 2008

2. Most basic database connection for Visual Basic 2008

3. How to invoke form designer in Visual Basic 2008 Express Edition

4. Visual Basic Express 2008 Custom Error Message

5. Visual Basic Express 2008 Edition and KB278379

6. Active Directory -- Computers in a Domain

7. Getting computer names from Active Directory

8. Active Directory User and Computers mappings for ADSI

9. Active Directory User and Computers Attributes Defined...

10. Active Directory Users and Computers

11. Get computer list from Active Directory

12. Active Directory User and Computers mappings for ADSI

 

 
Powered by phpBB® Forum Software