ADSI and VB .Net 
Author Message
 ADSI and VB .Net


  I have a VB6 program that I use in an NT 4.0 environment to get info on
user accounts, computers, domain info, etc., using ADSI.  Now I need the
same functionality in VB .Net, and can't seem to figure out how to do it.
I'm pulling my hair out here.

For example, here is a simple script/program to enumerate the Domain Admins

Dim Member
Dim txtFile as TextStream
Dim fso as FileSystemObject
Dim objGroup as IADsGroup
set fso = CreateObject("Scripting.FileSystemObject")
set txtFile = fso.CreateTextFile("C:\DomainAdmin.csv")

Set objGroup = GetObject("WinNT://" & insertdomainnamehere & "/Domain
Admins, group")

For Each Member in group.members
  txtfile.write ( & "," & member.description & vbcrlf)

Any ideas on how to make this work in .Net?


Dan Gilmore

Sun, 22 Aug 2004 23:39:24 GMT  
 ADSI and VB .Net


Thank you for using the Microsoft VB Newsgroups.

You can use DirectoryEntry of the System.DirectoryServices Namespace.

for a sample, please refer to:

Hope it helps. If you have any questions, please reply to this post.


Jian-Wei Yu
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Tue, 24 Aug 2004 15:02:05 GMT  
 [ 2 post ] 

 Relevant Pages 

1. ADSI and VB.NET

2. Using ADSI in Vb.NET

3. ADSI and VB.NET

4. ADSI in VB.Net...... Examples, anyone?

5. Creating NT User accounts using ADSI (WinNT:) within VB.Net

6. VB.Net - ADSI property name with dashes

7. ADSI & VB.Net

8. Filter ADSI objects in

9. ADSI code converstion to

10. ADSI and .Net

11. VB.NET: Steps for Converting a Windows .NET Application to a Web .NET Application

12. ADO.NET with ASP.NET using VB.NET


Powered by phpBB® Forum Software