.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

SharePoint, x64 and Impersonation

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :.NET Framework
What I need to do seems simple to me:  Take a file from a Document Library in SharePoint (MOSS 2007 V 3.0) and store it on a Network File Share.  The problem is, I cannot give the SharePoint worker process permissions to the share, nor can I use Kerberos delegation.  Also, my SharePoint implementation is on one domain, and the file share is on another domain, which has a 1-way trust between them. I'm trying to use the following code, as I've found all over the internet.  However, there seems to be some conflict between using a 32 bit dll inside 64 bit code.  My question is two-fold:  (1) Is there a better way I should be accomplishing my goal?  and (2) if Impersonation is indeed the answer, is there any way to get some form of impersonation working on an x64 system? Thanks in advance for any advice, code samples, etc that can be provided. public class FileArchivalViewerWP : Microsoft.SharePoint.WebPartPages.WebPart {      [DllImport("advapi32.dll", SetLastError = true)]      public static extern bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword,           int dwLogonType, int dwLogonProvider, ref IntPtr phToken);      [DllImport("kernel32.dll", CharSet = CharSet.Auto)]   &n

View Complete Post

More Related Resource Links

Sharepoint IIS Default WebSite ASP.NET impersonation


Curious why ASP.NET impersonation is enabled by default.  Is it because sharepoint needs this enabled?  I would like to disable so that I can use Windows Authentication for custom web parts to access a remote sql server, this way I can use the domain user i set for the app pool.  Or is there a recommended way?

Sharepoint IIS Default WebSite ASP.NET impersonation


Curious why ASP.NET impersonation is enabled by default.  Is it because sharepoint needs this enabled?  I would like to disable so that I can use Windows Authentication for custom web parts to access a remote sql server, this way I can use the domain user i set for the app pool.  Or is there a recommended way?

Sharepoint Authentication Impersonation


I am stumped on this one and really need a nudge in the right direction.


Scenario:  Currently have Sharepoint 2007 running using Windows Authentication to access any sites.  I have an application that will reside on client workstations (C# Windows Application) and i would like to grant them to a particular site automatically.  Essentially the application will spawn a form that opens the desired sharepoint site but uses predetermined credentials so they are not forced to login.

I have tried a few things trying to make impersonation work but this does not seem to do the trick as the second i access the sharepoint site up pops the windows authentication window.

Is it possible to gain access to Sharepoint (remotely and outside the sharepoint domain) in this way?  If it helps i am also stuck using .NET 2.0 for any applications that would be developed. 

Impersonation in sharepoint 2010


Hi All,

How can I implement the impersonation through the site in sharepoint 2010?

I used the below url code in moss 2007,it worked well.But it is not working in sp 2010


Please let me know how can i implement in sharepoint 2010.


cannot add Impersonation step in approval workflow sharepoint 2010



I am using SharePoint 2010 approval workflow, where users fill infopath form and submits it to form library and manually starts workflow on that item with their choice of approvers, my requirement is i need to break permissions when workflow starts on that item and give permissions to user and approvers only .

is there anyway to do it?




Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Displaying SharePoint lists in Web Parts

When you create a built-in or custom list in Microsoft Windows SharePoint Services, Windows SharePoint Services creates a Web Part, a basic building block of a SharePoint site, to display that list. These Web Parts are called List View Web Parts. Windows SharePoint Services stores List View Web Parts in the site collection Web Part gallery. (The site collection Web Part gallery is the most central gallery of Web Parts for a work group. By default, the gallery name is the name of the site, such as "Our Team Site Web Part Gallery." )

Take a tour of your SharePoint site

What is a SharePoint site for?
A SharePoint site is a Web site that provides a central storage and collaboration space for documents, information, and ideas. A SharePoint site is a tool for collaboration, just like a telephone is a tool for communication, or a meeting is a tool for decision making. A SharePoint site helps groups of people (whether work teams or social groups) share information and work together. For example, a SharePoint site can help you:

Coordinate projects, calendars, and schedules.
Discuss ideas and review documents or proposals.
Share information and keep in touch with other people.

Six easy ways to customize your site using Web Parts in SharePoint

Becoming familiar with Web Part customization techniques gives you a range of page-customization choices. For example, you can customize your site's home page so that it displays the specific information that your team needs. You can rearrange the list items on the home page, add lists, and even change the images on the home page. As you become more familiar with Web Part Page customization techniques, you can build interactive Web Part Pages that makes the data in lists more dynamic and useful, and you can add new Web Parts that provide access to external data and Web services.

Working with SharePoint document libraries

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. For example, you can create a library of common documents for a project, and team members can use their Web browsers to find the files, read them, and make comments. Users with Microsoft Office 2003 can check out and edit the files as if they resided on a local or network drive.

By default, your team Web site comes with a built-in document library named Shared Documents, which is listed on the Quick Launch bar as well as on the Documents and Lists page.

Out of the Depths of SharePoint's XML Hell

I described how a new open source tool called sporm significantly simplifies unit testing SharePoint. Making SharePoint unit testable is my absolute favorite feature of sporm because SharePoint is notoriously hard to unit test. But sporm provides other benefits as well and its ability to pull us out of the depths of verbose loosely typed XML hell and into LINQ excellence is next on my list of favorite features. So in this post I'll describe the pre-sporm technique of querying with CAML, how to query data using sporm, and finally how sporm supports SharePoint's unique architecture of allowing multiple content types per list and what that means to you.

Unit Testing SharePoint - Past, Present, and Sporm

As I described in SharePoint: The Wild West of Software Development there is a serious problem when you develop for SharePoint: ensuring quality through unit testing is really, really hard. And that's where a new open source tool just released today called sporm (SharePoint Object Relational Mapper) comes in. While sporm provides many benefits besides simplified unit testing I wanted to focus on this topic first, because sporm's approach, which models the entity framework in the way it supports POCO's, is a unique feature not available with other SharePoint tools like LINQ to SharePoint.

SharePoint Tutorial - Web Parts

A page in SharePoint is comprised of web parts the exist within zones. Web parts are available for just about everything. For example in the page below there are four web part highlighted by different colors. The purple web part displays a short list of the new announcements stored in the annoucements library. The pink web part displays events from a calendar within the site. The green web part displays an image from a location the user specifies. The gray web part displays a list of links from the links list on the site.

SharePoint Tutorial - Team Sites

Team sites are small web sites that are created to store everything about a particular thing. For example a site can be created for a department in an organization like human resources. I site can be created for a particular project. A site can even be created for a meeting. Everything about the thing (department, project, meeting) like documents, lists, calendars, etc. is stored in that site.

SharePoint Tutorial - Libraries

A library is a feature in SharePoint that stores files (documents). Think of a library as a folder on your file system. For example, a library can be created to store resumes in the human resources team site. A library is usually created for a specific type of file. Libraries can contain metadata to describe the particular file in more detail and to make it easier to find.

SharePoint Tutorial - Lists

A list is a feature in SharePoint that stores a lists of information. For example, a list can be created to store web links in the human resources team site. A list is usually created for a specific type of information. Lists can contain metadata to describe the particular information in more detail and to make it easier to find.

SharePoint Tutorial - Security

Security in SharePoint is comprised of users, groups and roles.

Users, Groups and Roles

A user account comes from the authentication system. For example, if Active Directory is used to authenticate then the user accounts will come from it.

There are two types of groups SharePoint uses: domain groups and SharePoint groups.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend