Directory Programming .NET

Active Directory and ADAM programming support for .NET developers
Welcome to Directory Programming .NET Sign in | Join | Help
in Search

Unauthorized exception

Last post 04-06-2010, 6:37 PM by Davidida. 0 replies.
Sort Posts: Previous Next
  •  04-06-2010, 6:37 PM 8157

    Unauthorized exception

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
    I am trying to the use method called  "moveto" to move a user from one container to another in C#.

    DirectoryEntry dirEntry = new DirectoryEntry( "LDAP://CN=test test,OU=Cap,DC=adc,DC=xyz");
    DirectoryEntry dirEntry1 = new DirectoryEntry("LDAP:// OU=App,
    DC=adc,DC=xyz");
     dirEntry.MoveTo(dirEntry1);

     On my local machine everything works perfectly but on the server 2003 machine display this message

      General access denied error

    This is Unauthorized exception error  

       at System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsContainer.MoveHere(String sourceName, String newName)

       at System.DirectoryServices.DirectoryEntry.MoveTo(DirectoryEntry newParent, String newName)

       at System.DirectoryServices.DirectoryEntry.MoveTo(DirectoryEntry newParent)

       at BridgeActiveDirectoryLibs.ADHelper.MoveUserOneContainertoTheNext(DirectoryEntry Entry, String newContainer, String oldContainer, String loginName) in

    The wired thing about this issue is that all the rest of my method are work perfectly both on the server and local. Can anyone figure out what's wrong??
View as RSS news feed in XML