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. Advertising

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. Alex Moreno

    python and printers

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

    ASP.NET and Bluetooth Printers

    z71mdridin, Feb 25, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    544
    Eliyahu Goldin
    Feb 26, 2008
  5. Bill Belliveau

    DirectoryEntry Impersonate or WindowsIdentity Impersonate?

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

Share This Page