donderdag 15 december 2011

Access Active Directory in Sharepoint Application Page


Had to create a redirection page this week that forwarded some Active Directory information 
to an external Site for automatic loggon. When deploying my solution to the Sharepoint Server 
my code didn't worked for normal users. Found the solution that my testing user 
had Farm Admin privileges, for accessing the Active Directory normal users 
had'nt enougth rights to excecute the AD call.

Solution found on msdn was to elevate the privileges for specific part of code 
that needs that kind of rights.


SPSecurity.RunWithElevatedPrivileges(delegate() {
// YOUR CODE THAT NEEDS ELEVATED PRIVILEGES
});
 

Geen opmerkingen:

Een reactie posten