Note that there are some explanatory texts on larger screens.

plurals
  1. POImpersonating word.application
    primarykey
    data
    text
    <p>I have a question.. Here is the code i am currently working on...</p> <pre><code>Line 1: MessageBox.Show(System.Security.Principal.WindowsIdentity.GetCurrent().User.ToString()); Line 2: using ( new Impersonator( "testAdmin", "", "testAdmin" ) ) Line 3: { Line 4: word.Application wd = null; wd = new word.Application(); Line 5: MessageBox.Show(System.Security.Principal.WindowsIdentity.GetCurrent().User.ToString()); Line 6: } </code></pre> <p>The impersonator class works perfectly fine.. when i do a GetCurrent(), i get a different values at Line 1 and Line 5. However, when i try to create a winword.exe process at Line 4, the winword.exe was not created using the impersonated user.. Is there any other way to accomplish this task </p> <p>The impersonator class used: <a href="http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=10090&amp;display=Mobile&amp;zep=ImpersonatorDemo%2fImpersonator.cs&amp;rzp=%2fKB%2fcs%2fzetaimpersonator%2f%2fzetaimpersonator_demo.zip" rel="nofollow noreferrer">http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=10090&amp;display=Mobile&amp;zep=ImpersonatorDemo%2fImpersonator.cs&amp;rzp=%2fKB%2fcs%2fzetaimpersonator%2f%2fzetaimpersonator_demo.zip</a> </p> <p>Is there a better way to impersonate the word.application ? or am I doing this the wrong way ?</p> <p>Thanks in advance!</p> <p>-Rupesh</p> <hr> <p>Update: I finally figured out how to run initiate a new process using new credentials (Not the current user). Thanks to this post: <a href="https://stackoverflow.com/questions/480358/run-new-process-as-different-user-in-vb-net">Run new process as different user in vb.net</a></p> <p>Now the question.. How do I associate this object (using PID) to "wd" object @ Line 2 ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload