Results 1 to 3 of 3

Thread: ADSI with .NET *RESOLVED*

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2003
    Location
    Cape Cod, US
    Posts
    292

    Question ADSI with .NET *RESOLVED*

    Has anyone had any luck using the WinNT provider (ie WinNT://) along with the System.DirectoryServices namespace to perform Windows Group management tasks.

    I want to Add/Remove users To/From Groups and at first this looked to be a piece of cake with DirectoryServices but I've had no joy so far.

    In fact I've given up and am using the COM IADs interface instead but am still curious whether it's possible with a .Net component.
    Last edited by fungi; Feb 20th, 2003 at 03:17 PM.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    http://www.dotnet247.com/247referenc.../17/88443.aspx

    There are a few code snippets that should work for ya.

    Actually I noticed that the code was in C# so here it is in VB just in case you can't translate.

    VB Code:
    1. Dim entry As New DirectoryEntry("WinNT://MHC/WINS Users")
    2.         entry.Invoke("add", New Object() {"WinNT://MHC/edm"})
    3.         entry.Invoke("remove", New Object() {"WinNT://MHC/edm"})
    Last edited by Edneeis; Feb 20th, 2003 at 02:41 PM.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2003
    Location
    Cape Cod, US
    Posts
    292
    Thanks Ed for that sample and the link. Thanks especially for showing me that nifty "invoke" method. So that's how you get at the native interfaces lurking under the covers...

    As you can tell I'm new to this .Net lark but loving every line of code so far...

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