Click here to Skip to main content
15,895,256 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to insert all characters in database Pin
Beiniam3-Jun-13 21:05
Beiniam3-Jun-13 21:05 
AnswerRe: How to insert all characters in database Pin
Bernhard Hiller3-Jun-13 21:22
Bernhard Hiller3-Jun-13 21:22 
GeneralRe: How to insert all characters in database Pin
Beiniam3-Jun-13 22:22
Beiniam3-Jun-13 22:22 
AnswerRe: How to insert all characters in database Pin
Richard MacCutchan3-Jun-13 22:57
mveRichard MacCutchan3-Jun-13 22:57 
AnswerRe: How to insert all characters in database Pin
Simon_Whale3-Jun-13 23:04
Simon_Whale3-Jun-13 23:04 
SuggestionRe: How to insert all characters in database Pin
Richard Deeming4-Jun-13 1:54
mveRichard Deeming4-Jun-13 1:54 
GeneralRe: How to insert all characters in database Pin
Beiniam4-Jun-13 3:02
Beiniam4-Jun-13 3:02 
QuestionUnable to Update LDAP property "department" Pin
David Mujica3-Jun-13 10:12
David Mujica3-Jun-13 10:12 
I'm trying to create a utility to perform a mass update of our Active Directory and all I get is the error, "Server is unwilling to process request."

Below is my code:

VB
Dim de As New DirectoryEntry("GC://DC=us,DC=myCompany,DC=com", "myDomain\MyAdminUsername", "myPassword")

        Dim ds As New DirectorySearcher(de)
        ds.PropertiesToLoad.Add("department")
        ds.SearchScope = SearchScope.Subtree

        Dim ue As New DirectoryEntry   
        
        ds.Filter = String.Format("(SAMAccountName={0})", Me.tboxUserName.Text)

        Try
            ue = ds.FindOne.GetDirectoryEntry

            For Each sproperty As String In ue.Properties.PropertyNames
                debug.print(String.Format("{0}{1} : {2} ", System.Environment.NewLine, sproperty, ue.Properties(sproperty)(0)))
            Next

           
            ' test the update here ...

            If (ue.Properties.Contains("department")) Then
                ue.Properties("department").Value = "IT"
            Else
                ue.Properties("department").Add("IT")
            End If

            ue.CommitChanges()
            ue.RefreshCache()
            ue.Close()

        Catch ex As Exception
           
           debug.print (ex.Message)

        End Try


The code seems to connect to the LDAP server and retrieve the correct user because I can see valid data being displayed from the ue.Properties.PropertyNames collection.

The error is thrown on the "CommitChanges()" line.

BTW: This demo program is a WinForms .NET 4.0 applicaiton

I have tried it passing no credentials and passing valid domain credentials and I get the same " ... unwilling to process request." error.

What am I doing wrong?
AnswerRe: Unable to Update LDAP property "department" Pin
Bernhard Hiller3-Jun-13 21:20
Bernhard Hiller3-Jun-13 21:20 
GeneralRe: Unable to Update LDAP property "department" Pin
David Mujica5-Jun-13 0:23
David Mujica5-Jun-13 0:23 
QuestionHow difficult to switch from DoEvents to Threading? Pin
treddie2-Jun-13 11:19
treddie2-Jun-13 11:19 
AnswerRe: How difficult to switch from DoEvents to Threading? Pin
Dave Kreskowiak2-Jun-13 19:28
mveDave Kreskowiak2-Jun-13 19:28 
GeneralRe: How difficult to switch from DoEvents to Threading? Pin
treddie2-Jun-13 20:57
treddie2-Jun-13 20:57 
QuestionVB.NET and PHP mysql connection Pin
Amiet_Mhaske2-Jun-13 9:52
Amiet_Mhaske2-Jun-13 9:52 
QuestionThe old DoEvents and UserControls Pin
treddie1-Jun-13 18:41
treddie1-Jun-13 18:41 
AnswerRe: The old DoEvents and UserControls Pin
Dave Kreskowiak2-Jun-13 4:03
mveDave Kreskowiak2-Jun-13 4:03 
GeneralRe: The old DoEvents and UserControls Pin
treddie2-Jun-13 7:21
treddie2-Jun-13 7:21 
GeneralRe: The old DoEvents and UserControls Pin
Dave Kreskowiak2-Jun-13 7:42
mveDave Kreskowiak2-Jun-13 7:42 
GeneralRe: The old DoEvents and UserControls Pin
treddie2-Jun-13 9:26
treddie2-Jun-13 9:26 
GeneralRe: The old DoEvents and UserControls Pin
Dave Kreskowiak2-Jun-13 14:21
mveDave Kreskowiak2-Jun-13 14:21 
GeneralRe: The old DoEvents and UserControls Pin
treddie2-Jun-13 16:33
treddie2-Jun-13 16:33 
GeneralRe: The old DoEvents and UserControls Pin
Dave Kreskowiak2-Jun-13 19:25
mveDave Kreskowiak2-Jun-13 19:25 
GeneralRe: The old DoEvents and UserControls Pin
treddie2-Jun-13 21:02
treddie2-Jun-13 21:02 
Questionlooping through rows and columns of a datarow Pin
hlsc19831-Jun-13 8:21
hlsc19831-Jun-13 8:21 
Questionhow to loop through items(columns) of a row in a dataset? Pin
hlsc198331-May-13 21:49
hlsc198331-May-13 21:49 

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.