Impersonate by code and printers ?

Discussion in 'ASP .Net Security' started by Pascal Gineste, Sep 9, 2004.

  1. We want to convert an excel file to a pdf file using a PDF printer
    driver.
    This uses a Postscript printer driver with a redirected port
    "PDFCreator sur Ne00:"

    to print with asp.net; i impersonate with code with logonuser and
    duplicatetoken (i tried also duplicatetokenex with primary token and
    also
    SecurityDelegation).

    the user (Usr1) i use to impersonate is administrateur of the serveur
    and he can
    access the directory where the excel and pdf will be generated.

    the excel file is generated correctly (with OleDb and configuring
    dcomcnfg)
    however, after impersonating, i reopen the excel file (with OleDb) and
    i
    execute :

    Workbook.PrintOut(1, iNbPages, 1, false, sNomImprimante,missing,
    missing,missing);

    -> it blocks if the user i mention (Usr1 of domain Domn1) during
    impersonation by code is not logged
    in on the server.
    however, if Usr1 is logged on on the server, the pdf file is generated
    correctly.

    The problem is that i don't want the web server to be logged on always
    with
    this user account usr1.

    I have found a temporary solution (not very secure .....) : if i start
    aspnet_wp.exe with Domn1\Usr1, it works correctly and i don't need
    anymore
    to be logged on the server and i also don't need anymore to
    impersonate
    by code as usr1.

    Have you got any idea ?
    Thanks in advance
     
    Pascal Gineste, Sep 9, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Y21heQ==?=

    Impersonate via code?

    =?Utf-8?B?Y21heQ==?=, Feb 24, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,589
  2. Alex Moreno

    python and printers

    Alex Moreno, May 13, 2005, in forum: Python
    Replies:
    0
    Views:
    329
    Alex Moreno
    May 13, 2005
  3. lmttag
    Replies:
    5
    Views:
    1,165
    Steven Cheng[MSFT]
    May 3, 2007
  4. Luqman
    Replies:
    2
    Views:
    583
    Luqman
    Sep 6, 2007
  5. z71mdridin

    ASP.NET and Bluetooth Printers

    z71mdridin, Feb 25, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    635
    Eliyahu Goldin
    Feb 26, 2008
  6. AvaDev
    Replies:
    3
    Views:
    1,052
    AvaDev
    Jul 10, 2008
  7. Bill Belliveau

    DirectoryEntry Impersonate or WindowsIdentity Impersonate?

    Bill Belliveau, Jan 28, 2004, in forum: ASP .Net Security
    Replies:
    3
    Views:
    734
    Joe Kaplan \(MVP - ADSI\)
    Jan 31, 2004
  8. RAT

    LWP and Xerox printers

    RAT, Jul 28, 2011, in forum: Perl Misc
    Replies:
    1
    Views:
    227
    J. Gleixner
    Jul 28, 2011
Loading...