Thanks -
Ive got it up and working now - in case anyone else gets stuck here is
what I did -
Public Shared Function GetDirectoryEntry() As DirectoryEntry
Dim dirEntry As DirectoryEntry = New DirectoryEntry
dirEntry.Path = "LDAP://172.29.33.20/CN=Users;DC=NWIE"
dirEntry.Username = "nwie\smsclient_sfw"
dirEntry.Password = "GoBucks05"
Return dirEntry
End Function
Private Shared Function GetDirectoryObject() As DirectoryEntry
Dim oDE As DirectoryEntry
'oDE = New DirectoryEntry(ADFullPath, ADAdminUser,
ADAdminPassword, AuthenticationTypes.Secure)
oDE = New DirectoryEntry(ADFullPath)
Return oDE
End Function
Public Shared Function GetProperty(ByVal oDE As DirectoryEntry,
ByVal PropertyName As String) As String
If oDE.Properties.Contains(PropertyName) Then
Return oDE.Properties(PropertyName)(0).ToString()
Else
Return String.Empty
End If
End Function
Public Shared Function GetUsersinGroup(ByVal GroupName As String)
As DataSet
Dim dsUsers As New DataSet
Dim dirEntry As DirectoryEntry = GetDirectoryObject()
Dim dirSearch As New DirectorySearcher
dirSearch.SearchRoot = dirEntry
dirSearch.Filter = "(&(objectClass=group)(cn=" + GroupName +
"))"
Dim searchResults As SearchResult = dirSearch.FindOne()
Dim dtUser As DataTable = dsUsers.Tables.Add("Users")
dtUser.Columns.Add("UserName")
dtUser.Columns.Add("DisplayName")
dtUser.Columns.Add("EMailAddress")
Dim drUser As DataRow = dtUser.NewRow()
drUser("UserName") = "0"
drUser("DisplayName") = "(Not Specified)"
drUser("EMailAddress") = "(Not Specified)"
dtUser.Rows.Add(drUser)
If Not searchResults Is Nothing Then
Dim dirGroup As New DirectoryEntry(searchResults.Path)
Dim propCollection As PropertyCollection =
dirGroup.Properties
Dim n As Integer = propCollection("member").Count
For l As Integer = 0 To n - 1
Dim deUser As New DirectoryEntry(ADFullPath + "/" +
propCollection("member")(l).ToString())
Dim rwUser As DataRow = dtUser.NewRow()
rwUser("UserName") = GetProperty(deUser, "cn")
rwUser("DisplayName") = GetProperty(deUser,
"givenName") + " " + GetProperty(deUser, "sn")
rwUser("EMailAddress") = GetProperty(deUser, "mail")
dtUser.Rows.Add(rwUser)
deUser.Close()
Next
dirEntry.Close()
dirGroup.Close()
End If
Return dsUsers
End Function
Were using wss 2003, not wss 3.0 so i couldnt use the sharepoint
functionality.