T
Terry Olsen
I'm currently using the following function to return an ArrayList:
Private Function ADSIReturnComputers(ByVal BldgMnemonic As String) As
ArrayList
Dim x As New ArrayList
Using oDirectoryEntry As DirectoryEntry = New
DirectoryEntry("LDAP://us.ups.com")
Using oDirectorySearcher As DirectorySearcher = New
DirectorySearcher(oDirectoryEntry)
oDirectorySearcher.Filter =
"(&(ObjectClass=Computer)(cn=" & BldgMnemonic & "*))"
For Each oResult As SearchResult In
oDirectorySearcher.FindAll
x.Add(oResult.GetDirectoryEntry.Name)
Next
End Using
End Using
Return x
End Function
Is there an easy way to return just a static array of string? Or would
that be more work than it's worth?
Private Function ADSIReturnComputers(ByVal BldgMnemonic As String) As
ArrayList
Dim x As New ArrayList
Using oDirectoryEntry As DirectoryEntry = New
DirectoryEntry("LDAP://us.ups.com")
Using oDirectorySearcher As DirectorySearcher = New
DirectorySearcher(oDirectoryEntry)
oDirectorySearcher.Filter =
"(&(ObjectClass=Computer)(cn=" & BldgMnemonic & "*))"
For Each oResult As SearchResult In
oDirectorySearcher.FindAll
x.Add(oResult.GetDirectoryEntry.Name)
Next
End Using
End Using
Return x
End Function
Is there an easy way to return just a static array of string? Or would
that be more work than it's worth?