Results 1 to 2 of 2

Thread: Newbie ADSI and VB.net

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    1

    Newbie ADSI and VB.net

    Hello, I've just went from VB 6 to the .Net platsform resently and I have som question regarding the use of ADSI in .net.

    To use an example:
    in VB 6 I use this lines of code to add a user to Active directory:
    user = "foo"
    hostname = "bar"
    Set userobj = GetObject("WinNT://" & hostname & ",computer")
    Set usercreateobj = userobj.Create("user", UserName)

    --

    How do I use the GETOBJECT in vb.net?

    Is there another way?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    The objects associated with AD are in the DirectoryServices namespace which you will probably have to make a reference to in order to use. It is a bit more complicated in .NET and unfortunately I don't have any code to add a new user for you, but I did post some code to get the groups a user belongs to which should help.

    http://www.vbcity.com/forums/topic.a...1346&#RID64857

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width