I'm currently using the following function to return an ArrayList:
Private Function ADSIReturnCompu ters(ByVal BldgMnemonic As String) As
ArrayList
Dim x As New ArrayList
Using oDirectoryEntry As DirectoryEntry = New
DirectoryEntry( "LDAP://us.ups.com")
Using oDirectorySearc her As DirectorySearch er = New
DirectorySearch er(oDirectoryEn try)
oDirectorySearc her.Filter =
"(&(ObjectClass =Computer)(cn=" & BldgMnemonic & "*))"
For Each oResult As SearchResult In
oDirectorySearc her.FindAll
x.Add(oResult.G etDirectoryEntr y.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?
*** Sent via Developersdex http://www.developersdex.com ***
Private Function ADSIReturnCompu ters(ByVal BldgMnemonic As String) As
ArrayList
Dim x As New ArrayList
Using oDirectoryEntry As DirectoryEntry = New
DirectoryEntry( "LDAP://us.ups.com")
Using oDirectorySearc her As DirectorySearch er = New
DirectorySearch er(oDirectoryEn try)
oDirectorySearc her.Filter =
"(&(ObjectClass =Computer)(cn=" & BldgMnemonic & "*))"
For Each oResult As SearchResult In
oDirectorySearc her.FindAll
x.Add(oResult.G etDirectoryEntr y.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?
*** Sent via Developersdex http://www.developersdex.com ***
Comment