Click here to Skip to main content
15,912,329 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: null delimited string Pin
steff kamush18-Feb-04 5:35
steff kamush18-Feb-04 5:35 
GeneralRe: null delimited string Pin
r i s h a b h s18-Feb-04 16:45
r i s h a b h s18-Feb-04 16:45 
GeneralRe: null delimited string Pin
steff kamush19-Feb-04 4:32
steff kamush19-Feb-04 4:32 
GeneralRe: null delimited string Pin
r i s h a b h s19-Feb-04 17:58
r i s h a b h s19-Feb-04 17:58 
GeneralGet domains & workgroups-reply plzzzz Pin
radhika8117-Feb-04 19:11
radhika8117-Feb-04 19:11 
GeneralRe: Get domains & workgroups-reply plzzzz Pin
John Kuhn17-Feb-04 19:25
John Kuhn17-Feb-04 19:25 
GeneralRe: Get domains & workgroups-reply plzzzz Pin
radhika8117-Feb-04 19:55
radhika8117-Feb-04 19:55 
GeneralRe: Get domains & workgroups-reply plzzzz Pin
John Kuhn17-Feb-04 20:04
John Kuhn17-Feb-04 20:04 
I think the key is to enumerate the Properties collection of each child node in the collection of DirectoryEntry children. While there may be a more elegant way of doing so, the way that I was able to get a list of users, for example, was to do something like this:

Dim entry As New DirectoryServices.DirectoryEntry
For Each child As DirectoryServices.DirectoryEntry In entry.Children
    Dim propertyValue As Integer = 0
    Try
        propertyValue = CType(child.Properties("UserFlags").Value, Integer)
    Catch ex As Exception
        ' if it throws an exception, it's not a user item
        propertyValue = 0
    End Try
    If (propertyValue = 513) Then
        Console.WriteLine(child.Name)
    End If
Next


If you look at the property names in the Properties collection, you should be able to isolate which ones are Domains, which ones are workgroups and which ones are users, etc. I believe there may be a more elegant solution, but I haven't found the best reference for that solution yet.


What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
Generalvbscript compiler error Pin
alan.net17-Feb-04 17:01
alan.net17-Feb-04 17:01 
GeneralRe: vbscript compiler error Pin
John Kuhn17-Feb-04 19:55
John Kuhn17-Feb-04 19:55 
Questionicons of task manager?? Pin
fordge17-Feb-04 15:16
fordge17-Feb-04 15:16 
QuestionWhat is ADO.NET? Pin
bensoncd17-Feb-04 12:46
bensoncd17-Feb-04 12:46 
AnswerRe: What is ADO.NET? Pin
John Kuhn17-Feb-04 15:50
John Kuhn17-Feb-04 15:50 
QuestionHow can I Display of File Creation Dates Pin
bensoncd17-Feb-04 12:44
bensoncd17-Feb-04 12:44 
AnswerRe: How can I Display of File Creation Dates Pin
Nadroj17-Feb-04 13:23
Nadroj17-Feb-04 13:23 
GeneralAdding a border in Excel using VB.NET Pin
nvmoss17-Feb-04 12:11
nvmoss17-Feb-04 12:11 
GeneralRe: Adding a border in Excel using VB.NET Pin
John Kuhn17-Feb-04 18:59
John Kuhn17-Feb-04 18:59 
GeneralRe: Adding a border in Excel using VB.NET Pin
Nick Seng18-Feb-04 15:10
Nick Seng18-Feb-04 15:10 
GeneralRe: Adding a border in Excel using VB.NET Pin
John Kuhn19-Feb-04 16:59
John Kuhn19-Feb-04 16:59 
GeneralDebug COM+ call to .NET Pin
Anonymous17-Feb-04 11:55
Anonymous17-Feb-04 11:55 
GeneralConverting Binary Files Pin
Anonymous17-Feb-04 6:27
Anonymous17-Feb-04 6:27 
GeneralRe: Converting Binary Files Pin
Dave Kreskowiak18-Feb-04 6:09
mveDave Kreskowiak18-Feb-04 6:09 
GeneralDetermining Hardware in machine Pin
LeprosyLM17-Feb-04 3:40
LeprosyLM17-Feb-04 3:40 
GeneralRe: Determining Hardware in machine Pin
LokmanHakim17-Feb-04 14:15
LokmanHakim17-Feb-04 14:15 
GeneralAdding a comment in Excel Pin
nvmoss17-Feb-04 2:08
nvmoss17-Feb-04 2:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.