Results 1 to 3 of 3

Thread: Getting CommitChanges General Access denied error in Active Directory

  1. #1
    Join Date
    Feb 2012
    Posts
    39

    Getting CommitChanges General Access denied error in Active Directory

    Hello I trying to create intranet web application where user can change their profile information in AD but while doing this I am getting error message saying that:” System.UnauthorizedAccessException: General access denied error at System.DirectoryServices.Interop.IAds.SetInfo() at System.DirectoryServices.DirectoryEntry.CommitChanges()”. So can anyone suggest me how to solve this issue? Below my code:

    Public sPath As String = "LDAP://domainname/OU=OITS,OU=ODI,DC=aa,DC=bb,DC=cc,DC=dd"

    Dim dsUser As DirectoryEntry = New DirectoryEntry(sPath, "domain/AdminID", "AdminPassword", AuthenticationTypes.Secure)

    dsUser = dsUser.Children.Find("CN=John")
    With dsUser.Properties
    .Item("displayname").Value = "John Doe"
    End With
    dsUser.CommitChanges()
    I getting error message while calling CommitChanges, so can anyone suggest me what’s solution to this issue.

  2. #2
    Join Date
    Nov 2011
    Posts
    91

    Re: Getting CommitChanges General Access denied error in Active Directory

    By looking your code I think your credentials to the user DirectoryEntry not transferring and so therefore your getting the issue. in its place of reusing the DirectoryEntry 'dsUser' I would like to suggest you to try to create a new one, the credentials might transfer in this case: here is sample code for this:

    Dim entry As DirectoryEntry = New DirectoryEntry(sPath, "domain/AdminID", "AdminPassword", AuthenticationTypes.Secure)

    Dim dsUser as DirectoryEntry = entry.Children.Find("CN=John")
    'Optionally Define username and password in case they are not xferring
    'dsUser.Username = "domain\adminid"
    'dsUser.Password = "AdminPassword"
    With dsUser.Properties
    .Item("displayname").Value = "John Doe"
    End With
    dsUser.CommitChanges()

  3. #3
    Join Date
    Jan 2009
    Posts
    150

    Re: Getting CommitChanges General Access denied error in Active Directory

    By looking at your code I am not sure your code will because I think your administration you are binding as does not have proper permissions. I think your username that is “CN= John” is an admin account but he have lower permission and with this account your trying to update it. So I think you should check out your administration permission of the account which you’re using here.

Similar Threads

  1. export details in active directory to Access 2003
    By hz84 in forum Active Directory
    Replies: 1
    Last Post: 21-05-2011, 06:56 AM
  2. General access denied error
    By attitude.ashwin in forum Active Directory
    Replies: 1
    Last Post: 14-05-2011, 09:42 AM
  3. How Active directory group access SQL server
    By FlayoFish in forum Operating Systems
    Replies: 3
    Last Post: 11-08-2009, 09:18 AM
  4. Configure Microsoft Active Directory for SSL Access
    By Isaivalan in forum Active Directory
    Replies: 3
    Last Post: 14-11-2008, 08:53 AM
  5. -2147024891: General access denied error
    By aileen in forum Active Directory
    Replies: 3
    Last Post: 01-03-2006, 03:51 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,466,092.63549 seconds with 16 queries