write to Active Directory


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: write to Active Directory

  1. #1
    Join Date
    Dec 2005
    Posts
    7

    write to Active Directory

    Hi,

    I need to write something to active directory, the structure of the Active Directory as below:

    DC
    - Account Group
    - xx group
    - Distribution Group
    - xx
    - Test
    - member 1 of test
    - member 2 of test

    I want to add another member to Test under Distribution Group, the code i am using as below, but it fails when executing the CommitChanges statement:

    Private Sub addToAD()

    Dim group As New DirectoryServices.DirectoryEntry("LDAP://DomainName/OU=Distribution Groups,DC=xx,DC=xxx")

    group.AuthenticationType = DirectoryServices.AuthenticationTypes.Delegation
    group.Username = "domainname\newUsername"
    group.Password = "password"

    Dim newdn As String
    newdn = "CN=newUsername,OU=-Test, OU=Distribution Groups,DC=xx,DC=xxx"
    group.Properties("member").Add(newdn)
    group.CommitChanges()

    End Sub
    Last edited by yolip; 01-19-2006 at 06:46 PM.

Similar Threads

  1. Active Directory or SQL server which way to go?
    By naijacoder in forum ASP.NET
    Replies: 5
    Last Post: 11-06-2005, 09:14 AM
  2. Replies: 1
    Last Post: 02-23-2005, 10:06 AM
  3. Adding Users in Active Directory
    By Samer in forum VB Classic
    Replies: 0
    Last Post: 01-31-2001, 07:15 AM
  4. Adding Users in Active Directory
    By Samer in forum VB Classic
    Replies: 0
    Last Post: 01-31-2001, 07:15 AM
  5. Active Directory ASP error
    By bill poulin in forum Enterprise
    Replies: 2
    Last Post: 06-11-2000, 11:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center