473,473 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# ASP.NET & Impersonation

I need to impersonate in ASP.NET in order to print a document to a printer.
The guidelines in http://support.microsoft.com/kb/306158/EN-US/ do not tell
about loading the user profile (LoadUserProfile).

Where should this call be inserted ?
TIA.
Nov 19 '05 #1
2 1510
you can call it anytime after you have a primary token. not sure why you
would load a profile, its not quick, nor is it needed to print. you would
also need to make the impersonated account an admin. note, you can only have
one profile per process, so don't switch.

-- bruce (sqlwork.com)


"Olivier Matrot" <ol************@online.nospam> wrote in message
news:uL**************@TK2MSFTNGP12.phx.gbl...
I need to impersonate in ASP.NET in order to print a document to a printer.
The guidelines in http://support.microsoft.com/kb/306158/EN-US/ do not
tell
about loading the user profile (LoadUserProfile).

Where should this call be inserted ?
TIA.

Nov 19 '05 #2
I need to use GetTempFileName after impersonation to create the file to
print.
After successfull impersonation, this function still return the path for
ASPNET account.

"Bruce Barker" <br******************@safeco.com> wrote in message
news:uw**************@TK2MSFTNGP15.phx.gbl...
you can call it anytime after you have a primary token. not sure why you
would load a profile, its not quick, nor is it needed to print. you would
also need to make the impersonated account an admin. note, you can only
have one profile per process, so don't switch.

-- bruce (sqlwork.com)


"Olivier Matrot" <ol************@online.nospam> wrote in message
news:uL**************@TK2MSFTNGP12.phx.gbl...
I need to impersonate in ASP.NET in order to print a document to a
printer.
The guidelines in http://support.microsoft.com/kb/306158/EN-US/ do not
tell
about loading the user profile (LoadUserProfile).

Where should this call be inserted ?
TIA.


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ripa Horatiu | last post by:
Does anyone knows how can I impersonate to another user (basically Administrator) for a piece of my code? I've tried the samples provided by MS but they didn't worked. -- Horatiu Ripa
12
by: Anil Krishnamurthy | last post by:
We have an ASP.NET application that uses COM objects through Interop. The web application requires access to network and database resources and hence, needs to impersonate a domain account. The...
0
by: matthew | last post by:
I am trying to create an Outlook application object in my asp.net page, but i get a message saying it could not create instance of server. The Event log tells me that 'The server {xxx-xxx-xxx} did...
1
by: techfuzz | last post by:
I'm posting my problem experience and solution I found here for other ASP.NET developers. I have a web application that uses Forms Authentication with Active Directory to control access. In...
4
by: TipTop | last post by:
I am trying to use integrated Windows authentication and impersonation to run a page that accesses SQL Server via integrated security. It's not working -- sort of. I've set IIS security to...
2
by: Matthew Lee | last post by:
I am using a C# / ASP.NET application to fire an XCOPY job from the webserver to a UNC share. This setup works fine when copying to a local machine but refuses to work on the remote copy. The...
4
by: Jason James | last post by:
Hi all, I am developing an ASP.NET app that will be deployed into a mixed NT4 & W2K domain. The PDC is running NT4 (I know we should have upgraded by now and it is on the cards but this is...
1
by: Patrick | last post by:
I have an ASP.NET web service whose Web.Config is set to use impersonation <authentication mode="Windows" /> <identity impersonate="true" /> Within a Web Method, I want to use...
5
by: =?Utf-8?B?S2l0dHlIYXdr?= | last post by:
I am in the process of migrating an II6 environment from a single server to a network load balanced system. Thus, I am using a virtual directory on a UNC share to house the dynamic data that the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.