|
-
Feb 20th, 2003, 02:15 PM
#1
Thread Starter
Hyperactive Member
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.
-
Feb 20th, 2003, 02:24 PM
#2
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:
Dim entry As New DirectoryEntry("WinNT://MHC/WINS Users")
entry.Invoke("add", New Object() {"WinNT://MHC/edm"})
entry.Invoke("remove", New Object() {"WinNT://MHC/edm"})
Last edited by Edneeis; Feb 20th, 2003 at 02:41 PM.
-
Feb 20th, 2003, 03:17 PM
#3
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|