Click here to Skip to main content
16,005,128 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Tab Pin
Mekong River14-Jun-06 23:27
Mekong River14-Jun-06 23:27 
GeneralRe: Tab Pin
Socheat.Net14-Jun-06 23:34
Socheat.Net14-Jun-06 23:34 
GeneralRe: Tab Pin
Mekong River15-Jun-06 0:13
Mekong River15-Jun-06 0:13 
QuestionTree View node editing during runtime Pin
Uma Kameswari14-Jun-06 21:19
Uma Kameswari14-Jun-06 21:19 
AnswerRe: Tree View node editing during runtime Pin
Mekong River14-Jun-06 22:12
Mekong River14-Jun-06 22:12 
Questionplease help me Pin
avinashprabhu.t.p14-Jun-06 21:08
avinashprabhu.t.p14-Jun-06 21:08 
AnswerRe: please help me Pin
Mekong River14-Jun-06 22:14
Mekong River14-Jun-06 22:14 
Questiongetting group information Pin
Bis198214-Jun-06 20:44
Bis198214-Jun-06 20:44 
Hello,

I'm trying to get the group in which a user is sitting. I searched and found an artikle here. Converted it from c# to VB.NET and made some changes.

This is the code:

Dim entry As New sys.DirectoryEntry("LDAP://WMU")
Dim search As sys.DirectorySearcher = New sys.DirectorySearcher(entry)
search.Filter = String.Format("(cn=*)", userName)
search.PropertiesToLoad.Add("memberOf")
Dim groupsList As System.Text.StringBuilder = New System.Text.StringBuilder
groupsList.Append("test")
result = search.FindOne()
If Not result Is Nothing Then
Dim groupCount As Integer
groupCount = result.Properties.Count
Dim counter As Integer

For counter = 0 To groupCount - 1 Step counter + 1
MessageBox.Show("in for loop")
If result.Properties.Contains("memberOf") Then
MessageBox.Show("In If statement")
groupsList.Append(CType(result.Properties("memberOf")(counter), String))
groupsList.Append("|")
End If
Next
End If
groupsList.Length -= 1 'remove the last "|" symbol
Return groupsList.ToString()

After some tests, i noticed that the code in the If condition never gets executed. So in other words, the property memberOf is not available.
What can i do to get it available?

Thanks in advance

Bis
AnswerRe: getting group information Pin
sasidar_d14-Jun-06 21:36
sasidar_d14-Jun-06 21:36 
GeneralRe: getting group information Pin
Bis198214-Jun-06 21:59
Bis198214-Jun-06 21:59 
GeneralRe: getting group information Pin
sasidar_d14-Jun-06 22:12
sasidar_d14-Jun-06 22:12 
GeneralRe: getting group information [modified] Pin
Bis198214-Jun-06 22:25
Bis198214-Jun-06 22:25 
QuestionHow to get the return value as the parameter? Pin
Ron.S14-Jun-06 19:22
Ron.S14-Jun-06 19:22 
AnswerRe: How to get the return value as the parameter? Pin
matsnas14-Jun-06 19:49
matsnas14-Jun-06 19:49 
AnswerRe: How to get the return value as the parameter? Pin
Steven J Jowett16-Jun-06 6:44
Steven J Jowett16-Jun-06 6:44 
Questioncannon DR2050c scanner Pin
Nitesh Malviya14-Jun-06 19:21
Nitesh Malviya14-Jun-06 19:21 
QuestionParent Children Form Pin
psmukil14-Jun-06 18:44
psmukil14-Jun-06 18:44 
AnswerRe: Parent Children Form [modified] Pin
zacharyshroyer15-Jun-06 4:10
zacharyshroyer15-Jun-06 4:10 
GeneralRe: Parent Children Form Pin
psmukil15-Jun-06 18:31
psmukil15-Jun-06 18:31 
Questionis BitBlt support Bitmap only? Pin
Danang Prakoso14-Jun-06 16:44
Danang Prakoso14-Jun-06 16:44 
QuestionHow to program Finger scanning Pin
Claton14-Jun-06 16:28
Claton14-Jun-06 16:28 
QuestionHow could i use this code??? Pin
mido1314-Jun-06 15:27
mido1314-Jun-06 15:27 
AnswerRe: How could i use this code??? Pin
Christian Graus14-Jun-06 15:47
protectorChristian Graus14-Jun-06 15:47 
Questionhow to create auto folder Pin
yaseerah14-Jun-06 14:37
yaseerah14-Jun-06 14:37 
QuestionDataGrid within a DataGrid Pin
ELiva14-Jun-06 11:50
ELiva14-Jun-06 11:50 

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.